Derive wxBitmap from wxBitmapBase in wxMotif, with the appropriate
changes to wxIcon. Fix deprecation warnings and use %p to format WXWidget in debug output (fixes the 4 non-deprecation warnings). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18818 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -123,7 +123,7 @@ wizard.cpp Generic
|
||||
appcmn.cpp Common Base
|
||||
artprov.cpp Common
|
||||
artstd.cpp Common
|
||||
bmpbase.cpp Common NotGTK,NotOS2,NotMSW,NotX,NotMicro
|
||||
bmpbase.cpp Common NotGTK,NotOS2,NotMSW,NotMicro
|
||||
choiccmn.cpp Common
|
||||
clipcmn.cpp Common
|
||||
clntdata.cpp Common Base
|
||||
|
@@ -32,7 +32,7 @@ class WXDLLEXPORT wxImage;
|
||||
class WXDLLEXPORT wxMask;
|
||||
class WXDLLEXPORT wxPalette;
|
||||
|
||||
#if defined(__WXMGL__) || defined(__WXMAC__)
|
||||
#if defined(__WXMGL__) || defined(__WXMAC__) || defined(__WXMOTIF__)
|
||||
// Only used by some ports
|
||||
// FIXME -- make all ports (but MSW which uses wxGDIImage) use these base classes
|
||||
|
||||
|
@@ -100,32 +100,35 @@ public:
|
||||
|
||||
#define M_BITMAPDATA ((wxBitmapRefData *)m_refData)
|
||||
|
||||
class WXDLLEXPORT wxBitmapHandler: public wxObject
|
||||
class WXDLLEXPORT wxBitmapHandler: public wxBitmapHandlerBase
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxBitmapHandler)
|
||||
public:
|
||||
wxBitmapHandler() { m_name = ""; m_extension = ""; m_type = 0; };
|
||||
wxBitmapHandler() : wxBitmapHandlerBase() { }
|
||||
|
||||
virtual bool Create(wxBitmap *bitmap, void *data, long flags,
|
||||
int width, int height, int depth = 1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual bool Create(wxBitmap *bitmap, void *data, long flags, int width, int height, int depth = 1);
|
||||
virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags,
|
||||
int desiredWidth, int desiredHeight);
|
||||
virtual bool SaveFile(wxBitmap *bitmap, const wxString& name, int type, const wxPalette *palette = NULL);
|
||||
int desiredWidth, int desiredHeight)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void SetName(const wxString& name) { m_name = name; }
|
||||
void SetExtension(const wxString& ext) { m_extension = ext; }
|
||||
void SetType(long type) { m_type = type; }
|
||||
wxString GetName() const { return m_name; }
|
||||
wxString GetExtension() const { return m_extension; }
|
||||
long GetType() const { return m_type; }
|
||||
protected:
|
||||
wxString m_name;
|
||||
wxString m_extension;
|
||||
long m_type;
|
||||
virtual bool SaveFile(const wxBitmap *bitmap, const wxString& name,
|
||||
int type, const wxPalette *palette = NULL)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxBitmapHandler)
|
||||
};
|
||||
|
||||
#define M_BITMAPHANDLERDATA ((wxBitmapRefData *)bitmap->GetRefData())
|
||||
|
||||
class WXDLLEXPORT wxBitmap: public wxGDIObject
|
||||
class WXDLLEXPORT wxBitmap: public wxBitmapBase
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxBitmap)
|
||||
|
||||
@@ -149,10 +152,11 @@ public:
|
||||
wxBitmap(char **data, wxControl* control);
|
||||
|
||||
// Load a file or resource
|
||||
wxBitmap(const wxString& name, int type = wxBITMAP_TYPE_XPM);
|
||||
wxBitmap(const wxString& name, wxBitmapType type = wxBITMAP_TYPE_XPM);
|
||||
|
||||
// Constructor for generalised creation from data
|
||||
wxBitmap(void *data, long type, int width, int height, int depth = 1);
|
||||
wxBitmap(void *data, wxBitmapType type,
|
||||
int width, int height, int depth = 1);
|
||||
|
||||
// If depth is omitted, will create a bitmap compatible with the display
|
||||
wxBitmap(int width, int height, int depth = -1);
|
||||
@@ -163,12 +167,15 @@ public:
|
||||
~wxBitmap();
|
||||
|
||||
virtual bool Create(int width, int height, int depth = -1);
|
||||
virtual bool Create(void *data, long type, int width, int height, int depth = 1);
|
||||
virtual bool Create(void *data, wxBitmapType type,
|
||||
int width, int height, int depth = 1);
|
||||
|
||||
wxBitmap GetSubBitmap( const wxRect& rect ) const;
|
||||
|
||||
virtual bool LoadFile(const wxString& name, long type = wxBITMAP_TYPE_XPM);
|
||||
virtual bool SaveFile(const wxString& name, int type, const wxPalette *cmap = NULL);
|
||||
virtual bool LoadFile(const wxString& name,
|
||||
wxBitmapType type = wxBITMAP_TYPE_XPM);
|
||||
virtual bool SaveFile(const wxString& name, wxBitmapType type,
|
||||
const wxPalette *cmap = NULL) const;
|
||||
|
||||
wxImage ConvertToImage() const;
|
||||
|
||||
@@ -197,16 +204,7 @@ public:
|
||||
bool operator != (const wxBitmap& bitmap) const { return m_refData != bitmap.m_refData; }
|
||||
|
||||
// Format handling
|
||||
static wxList& GetHandlers() { return sm_handlers; }
|
||||
static void AddHandler(wxBitmapHandler *handler);
|
||||
static void InsertHandler(wxBitmapHandler *handler);
|
||||
static bool RemoveHandler(const wxString& name);
|
||||
static wxBitmapHandler *FindHandler(const wxString& name);
|
||||
static wxBitmapHandler *FindHandler(const wxString& extension, long bitmapType);
|
||||
static wxBitmapHandler *FindHandler(long bitmapType);
|
||||
|
||||
static void InitStandardHandlers();
|
||||
static void CleanUpHandlers();
|
||||
|
||||
// Motif implementation
|
||||
public:
|
||||
@@ -217,9 +215,6 @@ public:
|
||||
virtual WXPixmap GetInsensPixmap(WXWidget w = (WXWidget) 0) ;
|
||||
void SetPixmapNull() { M_BITMAPDATA->m_pixmap = 0; }
|
||||
|
||||
protected:
|
||||
static wxList sm_handlers;
|
||||
|
||||
protected:
|
||||
bool CreateFromXpm(const char **bits);
|
||||
bool CreateFromImage(const wxImage& image, int depth);
|
||||
|
@@ -39,11 +39,11 @@ public:
|
||||
wxIcon(const char **data);
|
||||
wxIcon(char **data);
|
||||
|
||||
wxIcon(const wxString& name, long flags = wxBITMAP_TYPE_XPM,
|
||||
wxIcon(const wxString& name, wxBitmapType type = wxBITMAP_TYPE_XPM,
|
||||
int desiredWidth = -1, int desiredHeight = -1);
|
||||
~wxIcon();
|
||||
|
||||
bool LoadFile(const wxString& name, long flags = wxBITMAP_TYPE_XPM,
|
||||
bool LoadFile(const wxString& name, wxBitmapType type = wxBITMAP_TYPE_XPM,
|
||||
int desiredWidth = -1, int desiredHeight = -1);
|
||||
|
||||
// create from bitmap (which should have a mask unless it's monochrome):
|
||||
|
@@ -19,7 +19,7 @@
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#if defined(__WXMGL__) || defined(__WXMAC__)
|
||||
#if defined(__WXMGL__) || defined(__WXMAC__) || defined(__WXMOTIF__)
|
||||
|
||||
#include "wx/wx.h"
|
||||
#include "wx/setup.h"
|
||||
@@ -60,51 +60,51 @@ bool wxBitmapBase::RemoveHandler(const wxString& name)
|
||||
|
||||
wxBitmapHandler *wxBitmapBase::FindHandler(const wxString& name)
|
||||
{
|
||||
wxNode *node = sm_handlers.First();
|
||||
wxList::Node *node = sm_handlers.GetFirst();
|
||||
while ( node )
|
||||
{
|
||||
wxBitmapHandler *handler = (wxBitmapHandler *)node->Data();
|
||||
wxBitmapHandler *handler = (wxBitmapHandler *)node->GetData();
|
||||
if ( handler->GetName() == name )
|
||||
return handler;
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
wxBitmapHandler *wxBitmapBase::FindHandler(const wxString& extension, wxBitmapType bitmapType)
|
||||
{
|
||||
wxNode *node = sm_handlers.First();
|
||||
wxList::Node *node = sm_handlers.GetFirst();
|
||||
while ( node )
|
||||
{
|
||||
wxBitmapHandler *handler = (wxBitmapHandler *)node->Data();
|
||||
wxBitmapHandler *handler = (wxBitmapHandler *)node->GetData();
|
||||
if ( handler->GetExtension() == extension &&
|
||||
(bitmapType == -1 || handler->GetType() == bitmapType) )
|
||||
return handler;
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
wxBitmapHandler *wxBitmapBase::FindHandler(wxBitmapType bitmapType)
|
||||
{
|
||||
wxNode *node = sm_handlers.First();
|
||||
wxList::Node *node = sm_handlers.GetFirst();
|
||||
while ( node )
|
||||
{
|
||||
wxBitmapHandler *handler = (wxBitmapHandler *)node->Data();
|
||||
wxBitmapHandler *handler = (wxBitmapHandler *)node->GetData();
|
||||
if (handler->GetType() == bitmapType)
|
||||
return handler;
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void wxBitmapBase::CleanUpHandlers()
|
||||
{
|
||||
wxNode *node = sm_handlers.First();
|
||||
wxList::Node *node = sm_handlers.GetFirst();
|
||||
while ( node )
|
||||
{
|
||||
wxBitmapHandler *handler = (wxBitmapHandler *)node->Data();
|
||||
wxNode *next = node->Next();
|
||||
wxBitmapHandler *handler = (wxBitmapHandler *)node->GetData();
|
||||
wxList::Node *next = node->GetNext();
|
||||
delete handler;
|
||||
delete node;
|
||||
node = next;
|
||||
@@ -122,5 +122,5 @@ public:
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxBitmapBaseModule, wxModule)
|
||||
|
||||
#endif // defined(__WXMGL__) || defined(__WXMAC__)
|
||||
#endif // defined(__WXMGL__) || defined(__WXMAC__) || defined(__WXMOTIF__)
|
||||
|
||||
|
@@ -151,7 +151,7 @@ void wxTabControl::OnDraw(wxDC& dc, bool lastInRow)
|
||||
|
||||
int topY = m_view->GetViewRect().y - m_view->GetTopMargin();
|
||||
|
||||
int maxPositions = ((wxTabLayer *)m_view->GetLayers().Nth(0)->Data())->Number();
|
||||
int maxPositions = ((wxTabLayer *)m_view->GetLayers().Item(0)->GetData())->GetCount();
|
||||
|
||||
// Only down to the bottom of the tab, not to the top of the view
|
||||
if ( GetRowPosition() < (maxPositions - 1) )
|
||||
@@ -335,7 +335,7 @@ void wxTabControl::OnDraw(wxDC& dc, bool lastInRow)
|
||||
// TAB is not selected - just draw TAB outline and RH edge
|
||||
// if the TAB is the last in the row
|
||||
|
||||
int maxPositions = ((wxTabLayer*)m_view->GetLayers().Nth(0)->Data())->Number();
|
||||
int maxPositions = ((wxTabLayer*)m_view->GetLayers().Item(0)->GetData())->GetCount();
|
||||
wxTabControl* tabBelow = 0;
|
||||
wxTabControl* tabBelowRight = 0;
|
||||
if (GetColPosition() > 0)
|
||||
@@ -545,7 +545,7 @@ wxTabView::~wxTabView()
|
||||
wxTabControl *wxTabView::AddTab(int id, const wxString& label, wxTabControl *existingTab)
|
||||
{
|
||||
// First, find which layer we should be adding to.
|
||||
wxNode *node = m_layers.Last();
|
||||
wxNode *node = m_layers.GetLast();
|
||||
if (!node)
|
||||
{
|
||||
wxTabLayer *newLayer = new wxTabLayer;
|
||||
@@ -553,36 +553,36 @@ wxTabControl *wxTabView::AddTab(int id, const wxString& label, wxTabControl *exi
|
||||
}
|
||||
// Check if adding another tab control would go off the
|
||||
// right-hand edge of the layer.
|
||||
wxTabLayer *tabLayer = (wxTabLayer *)node->Data();
|
||||
wxNode *lastTabNode = tabLayer->Last();
|
||||
wxTabLayer *tabLayer = (wxTabLayer *)node->GetData();
|
||||
wxNode *lastTabNode = tabLayer->GetLast();
|
||||
if (lastTabNode)
|
||||
{
|
||||
wxTabControl *lastTab = (wxTabControl *)lastTabNode->Data();
|
||||
wxTabControl *lastTab = (wxTabControl *)lastTabNode->GetData();
|
||||
// Start another layer (row).
|
||||
// Tricky choice: can't just check if will be overlapping the edge, because
|
||||
// this happens anyway for 2nd and subsequent rows.
|
||||
// Should check this for 1st row, and then subsequent rows should not exceed 1st
|
||||
// in length.
|
||||
if (((tabLayer == m_layers.First()->Data()) && ((lastTab->GetX() + 2*lastTab->GetWidth() + GetHorizontalTabSpacing())
|
||||
if (((tabLayer == m_layers.GetFirst()->GetData()) && ((lastTab->GetX() + 2*lastTab->GetWidth() + GetHorizontalTabSpacing())
|
||||
> GetViewRect().width)) ||
|
||||
((tabLayer != m_layers.First()->Data()) && (tabLayer->Number() == ((wxTabLayer *)m_layers.First()->Data())->Number())))
|
||||
((tabLayer != m_layers.GetFirst()->GetData()) && (tabLayer->GetCount() == ((wxTabLayer *)m_layers.GetFirst()->GetData())->GetCount())))
|
||||
{
|
||||
tabLayer = new wxTabLayer;
|
||||
m_layers.Append(tabLayer);
|
||||
lastTabNode = (wxNode *) NULL;
|
||||
}
|
||||
}
|
||||
int layer = m_layers.Number() - 1;
|
||||
int layer = m_layers.GetCount() - 1;
|
||||
|
||||
wxTabControl *tabControl = existingTab;
|
||||
if (!existingTab)
|
||||
tabControl = OnCreateTabControl();
|
||||
tabControl->SetRowPosition(tabLayer->Number());
|
||||
tabControl->SetRowPosition(tabLayer->GetCount());
|
||||
tabControl->SetColPosition(layer);
|
||||
|
||||
wxTabControl *lastTab = (wxTabControl *) NULL;
|
||||
if (lastTabNode)
|
||||
lastTab = (wxTabControl *)lastTabNode->Data();
|
||||
lastTab = (wxTabControl *)lastTabNode->GetData();
|
||||
|
||||
// Top of new tab
|
||||
int verticalOffset = (- GetTopMargin()) - ((layer+1)*GetTabHeight());
|
||||
@@ -608,14 +608,14 @@ wxTabControl *wxTabView::AddTab(int id, const wxString& label, wxTabControl *exi
|
||||
// Remove the tab without deleting the window
|
||||
bool wxTabView::RemoveTab(int id)
|
||||
{
|
||||
wxNode *layerNode = m_layers.First();
|
||||
wxNode *layerNode = m_layers.GetFirst();
|
||||
while (layerNode)
|
||||
{
|
||||
wxTabLayer *layer = (wxTabLayer *)layerNode->Data();
|
||||
wxNode *tabNode = layer->First();
|
||||
wxTabLayer *layer = (wxTabLayer *)layerNode->GetData();
|
||||
wxNode *tabNode = layer->GetFirst();
|
||||
while (tabNode)
|
||||
{
|
||||
wxTabControl *tab = (wxTabControl *)tabNode->Data();
|
||||
wxTabControl *tab = (wxTabControl *)tabNode->GetData();
|
||||
if (tab->GetId() == id)
|
||||
{
|
||||
if (id == m_tabSelection)
|
||||
@@ -628,9 +628,9 @@ bool wxTabView::RemoveTab(int id)
|
||||
LayoutTabs();
|
||||
return TRUE;
|
||||
}
|
||||
tabNode = tabNode->Next();
|
||||
tabNode = tabNode->GetNext();
|
||||
}
|
||||
layerNode = layerNode->Next();
|
||||
layerNode = layerNode->GetNext();
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
@@ -659,21 +659,21 @@ int wxTabView::GetTotalTabHeight()
|
||||
{
|
||||
int minY = 0;
|
||||
|
||||
wxNode *layerNode = m_layers.First();
|
||||
wxNode *layerNode = m_layers.GetFirst();
|
||||
while (layerNode)
|
||||
{
|
||||
wxTabLayer *layer = (wxTabLayer *)layerNode->Data();
|
||||
wxNode *tabNode = layer->First();
|
||||
wxTabLayer *layer = (wxTabLayer *)layerNode->GetData();
|
||||
wxNode *tabNode = layer->GetFirst();
|
||||
while (tabNode)
|
||||
{
|
||||
wxTabControl *tab = (wxTabControl *)tabNode->Data();
|
||||
wxTabControl *tab = (wxTabControl *)tabNode->GetData();
|
||||
|
||||
if (tab->GetY() < minY)
|
||||
minY = tab->GetY();
|
||||
|
||||
tabNode = tabNode->Next();
|
||||
tabNode = tabNode->GetNext();
|
||||
}
|
||||
layerNode = layerNode->Next();
|
||||
layerNode = layerNode->GetNext();
|
||||
}
|
||||
|
||||
return - minY;
|
||||
@@ -681,21 +681,21 @@ int wxTabView::GetTotalTabHeight()
|
||||
|
||||
void wxTabView::ClearTabs(bool deleteTabs)
|
||||
{
|
||||
wxNode *layerNode = m_layers.First();
|
||||
wxNode *layerNode = m_layers.GetFirst();
|
||||
while (layerNode)
|
||||
{
|
||||
wxTabLayer *layer = (wxTabLayer *)layerNode->Data();
|
||||
wxNode *tabNode = layer->First();
|
||||
wxTabLayer *layer = (wxTabLayer *)layerNode->GetData();
|
||||
wxNode *tabNode = layer->GetFirst();
|
||||
while (tabNode)
|
||||
{
|
||||
wxTabControl *tab = (wxTabControl *)tabNode->Data();
|
||||
wxTabControl *tab = (wxTabControl *)tabNode->GetData();
|
||||
if (deleteTabs)
|
||||
delete tab;
|
||||
wxNode *next = tabNode->Next();
|
||||
wxNode *next = tabNode->GetNext();
|
||||
delete tabNode;
|
||||
tabNode = next;
|
||||
}
|
||||
wxNode *nextLayerNode = layerNode->Next();
|
||||
wxNode *nextLayerNode = layerNode->GetNext();
|
||||
delete layer;
|
||||
delete layerNode;
|
||||
layerNode = nextLayerNode;
|
||||
@@ -711,20 +711,20 @@ void wxTabView::LayoutTabs(void)
|
||||
// Make a list of the tab controls, deleting the wxTabLayers.
|
||||
wxList controls;
|
||||
|
||||
wxNode *layerNode = m_layers.First();
|
||||
wxNode *layerNode = m_layers.GetFirst();
|
||||
while (layerNode)
|
||||
{
|
||||
wxTabLayer *layer = (wxTabLayer *)layerNode->Data();
|
||||
wxNode *tabNode = layer->First();
|
||||
wxTabLayer *layer = (wxTabLayer *)layerNode->GetData();
|
||||
wxNode *tabNode = layer->GetFirst();
|
||||
while (tabNode)
|
||||
{
|
||||
wxTabControl *tab = (wxTabControl *)tabNode->Data();
|
||||
wxTabControl *tab = (wxTabControl *)tabNode->GetData();
|
||||
controls.Append(tab);
|
||||
wxNode *next = tabNode->Next();
|
||||
wxNode *next = tabNode->GetNext();
|
||||
delete tabNode;
|
||||
tabNode = next;
|
||||
}
|
||||
wxNode *nextLayerNode = layerNode->Next();
|
||||
wxNode *nextLayerNode = layerNode->GetNext();
|
||||
delete layer;
|
||||
delete layerNode;
|
||||
layerNode = nextLayerNode;
|
||||
@@ -735,10 +735,10 @@ void wxTabView::LayoutTabs(void)
|
||||
wxTabLayer *currentLayer = new wxTabLayer;
|
||||
m_layers.Append(currentLayer);
|
||||
|
||||
wxNode *node = controls.First();
|
||||
wxNode *node = controls.GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxTabControl *tabControl = (wxTabControl *)node->Data();
|
||||
wxTabControl *tabControl = (wxTabControl *)node->GetData();
|
||||
if (lastTab)
|
||||
{
|
||||
// Start another layer (row).
|
||||
@@ -746,9 +746,9 @@ void wxTabView::LayoutTabs(void)
|
||||
// this happens anyway for 2nd and subsequent rows.
|
||||
// Should check this for 1st row, and then subsequent rows should not exceed 1st
|
||||
// in length.
|
||||
if (((currentLayer == m_layers.First()->Data()) && ((lastTab->GetX() + 2*lastTab->GetWidth() + GetHorizontalTabSpacing())
|
||||
if (((currentLayer == m_layers.GetFirst()->GetData()) && ((lastTab->GetX() + 2*lastTab->GetWidth() + GetHorizontalTabSpacing())
|
||||
> GetViewRect().width)) ||
|
||||
((currentLayer != m_layers.First()->Data()) && (currentLayer->Number() == ((wxTabLayer *)m_layers.First()->Data())->Number())))
|
||||
((currentLayer != m_layers.GetFirst()->GetData()) && (currentLayer->GetCount() == ((wxTabLayer *)m_layers.GetFirst()->GetData())->GetCount())))
|
||||
{
|
||||
currentLayer = new wxTabLayer;
|
||||
m_layers.Append(currentLayer);
|
||||
@@ -756,9 +756,9 @@ void wxTabView::LayoutTabs(void)
|
||||
}
|
||||
}
|
||||
|
||||
int layer = m_layers.Number() - 1;
|
||||
int layer = m_layers.GetCount() - 1;
|
||||
|
||||
tabControl->SetRowPosition(currentLayer->Number());
|
||||
tabControl->SetRowPosition(currentLayer->GetCount());
|
||||
tabControl->SetColPosition(layer);
|
||||
|
||||
// Top of new tab
|
||||
@@ -776,7 +776,7 @@ void wxTabView::LayoutTabs(void)
|
||||
currentLayer->Append(tabControl);
|
||||
lastTab = tabControl;
|
||||
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
|
||||
// Move the selected tab to the bottom
|
||||
@@ -809,19 +809,19 @@ void wxTabView::Draw(wxDC& dc)
|
||||
}
|
||||
|
||||
// Draw layers in reverse order
|
||||
wxNode *node = m_layers.Last();
|
||||
wxNode *node = m_layers.GetLast();
|
||||
while (node)
|
||||
{
|
||||
wxTabLayer *layer = (wxTabLayer *)node->Data();
|
||||
wxNode *node2 = layer->First();
|
||||
wxTabLayer *layer = (wxTabLayer *)node->GetData();
|
||||
wxNode *node2 = layer->GetFirst();
|
||||
while (node2)
|
||||
{
|
||||
wxTabControl *control = (wxTabControl *)node2->Data();
|
||||
control->OnDraw(dc, (node2->Next() == NULL));
|
||||
node2 = node2->Next();
|
||||
wxTabControl *control = (wxTabControl *)node2->GetData();
|
||||
control->OnDraw(dc, (node2->GetNext() == NULL));
|
||||
node2 = node2->GetNext();
|
||||
}
|
||||
|
||||
node = node->Previous();
|
||||
node = node->GetPrevious();
|
||||
}
|
||||
|
||||
|
||||
@@ -883,14 +883,14 @@ bool wxTabView::OnEvent(wxMouseEvent& event)
|
||||
|
||||
wxTabControl *hitControl = (wxTabControl *) NULL;
|
||||
|
||||
wxNode *node = m_layers.First();
|
||||
wxNode *node = m_layers.GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxTabLayer *layer = (wxTabLayer *)node->Data();
|
||||
wxNode *node2 = layer->First();
|
||||
wxTabLayer *layer = (wxTabLayer *)node->GetData();
|
||||
wxNode *node2 = layer->GetFirst();
|
||||
while (node2)
|
||||
{
|
||||
wxTabControl *control = (wxTabControl *)node2->Data();
|
||||
wxTabControl *control = (wxTabControl *)node2->GetData();
|
||||
if (control->HitTest((int)x, (int)y))
|
||||
{
|
||||
hitControl = control;
|
||||
@@ -898,11 +898,11 @@ bool wxTabView::OnEvent(wxMouseEvent& event)
|
||||
node2 = (wxNode *) NULL;
|
||||
}
|
||||
else
|
||||
node2 = node2->Next();
|
||||
node2 = node2->GetNext();
|
||||
}
|
||||
|
||||
if (node)
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
|
||||
if (!hitControl)
|
||||
@@ -928,7 +928,7 @@ bool wxTabView::ChangeTab(wxTabControl *control)
|
||||
if (control == currentTab)
|
||||
return TRUE;
|
||||
|
||||
if (m_layers.Number() == 0)
|
||||
if (m_layers.GetCount() == 0)
|
||||
return FALSE;
|
||||
|
||||
if (!OnTabPreActivate(control->GetId(), oldTab))
|
||||
@@ -954,10 +954,10 @@ bool wxTabView::ChangeTab(wxTabControl *control)
|
||||
// without calling app activation code
|
||||
bool wxTabView::MoveSelectionTab(wxTabControl *control)
|
||||
{
|
||||
if (m_layers.Number() == 0)
|
||||
if (m_layers.GetCount() == 0)
|
||||
return FALSE;
|
||||
|
||||
wxTabLayer *firstLayer = (wxTabLayer *)m_layers.First()->Data();
|
||||
wxTabLayer *firstLayer = (wxTabLayer *)m_layers.GetFirst()->GetData();
|
||||
|
||||
// Find what column this tab is at, so we can swap with the one at the bottom.
|
||||
// If we're on the bottom layer, then no need to swap.
|
||||
@@ -968,7 +968,7 @@ bool wxTabView::MoveSelectionTab(wxTabControl *control)
|
||||
wxNode *thisNode = FindTabNodeAndColumn(control, &col);
|
||||
if (!thisNode)
|
||||
return FALSE;
|
||||
wxNode *otherNode = firstLayer->Nth(col);
|
||||
wxNode *otherNode = firstLayer->Item(col);
|
||||
if (!otherNode)
|
||||
return FALSE;
|
||||
|
||||
@@ -976,7 +976,7 @@ bool wxTabView::MoveSelectionTab(wxTabControl *control)
|
||||
if (otherNode == thisNode)
|
||||
return TRUE;
|
||||
|
||||
wxTabControl *otherTab = (wxTabControl *)otherNode->Data();
|
||||
wxTabControl *otherTab = (wxTabControl *)otherNode->GetData();
|
||||
|
||||
// We now have pointers to the tab to be changed to,
|
||||
// and the tab on the first layer. Swap tab structures and
|
||||
@@ -1060,19 +1060,19 @@ void wxTabView::SetTabSelection(int sel, bool activateTool)
|
||||
// Find tab control for id
|
||||
wxTabControl *wxTabView::FindTabControlForId(int id) const
|
||||
{
|
||||
wxNode *node1 = m_layers.First();
|
||||
wxNode *node1 = m_layers.GetFirst();
|
||||
while (node1)
|
||||
{
|
||||
wxTabLayer *layer = (wxTabLayer *)node1->Data();
|
||||
wxNode *node2 = layer->First();
|
||||
wxTabLayer *layer = (wxTabLayer *)node1->GetData();
|
||||
wxNode *node2 = layer->GetFirst();
|
||||
while (node2)
|
||||
{
|
||||
wxTabControl *control = (wxTabControl *)node2->Data();
|
||||
wxTabControl *control = (wxTabControl *)node2->GetData();
|
||||
if (control->GetId() == id)
|
||||
return control;
|
||||
node2 = node2->Next();
|
||||
node2 = node2->GetNext();
|
||||
}
|
||||
node1 = node1->Next();
|
||||
node1 = node1->GetNext();
|
||||
}
|
||||
return (wxTabControl *) NULL;
|
||||
}
|
||||
@@ -1080,37 +1080,37 @@ wxTabControl *wxTabView::FindTabControlForId(int id) const
|
||||
// Find tab control for layer, position (starting from zero)
|
||||
wxTabControl *wxTabView::FindTabControlForPosition(int layer, int position) const
|
||||
{
|
||||
wxNode *node1 = m_layers.Nth(layer);
|
||||
wxNode *node1 = m_layers.Item(layer);
|
||||
if (!node1)
|
||||
return (wxTabControl *) NULL;
|
||||
wxTabLayer *tabLayer = (wxTabLayer *)node1->Data();
|
||||
wxNode *node2 = tabLayer->Nth(position);
|
||||
wxTabLayer *tabLayer = (wxTabLayer *)node1->GetData();
|
||||
wxNode *node2 = tabLayer->Item(position);
|
||||
if (!node2)
|
||||
return (wxTabControl *) NULL;
|
||||
return (wxTabControl *)node2->Data();
|
||||
return (wxTabControl *)node2->GetData();
|
||||
}
|
||||
|
||||
// Find the node and the column at which this control is positioned.
|
||||
wxNode *wxTabView::FindTabNodeAndColumn(wxTabControl *control, int *col) const
|
||||
{
|
||||
wxNode *node1 = m_layers.First();
|
||||
wxNode *node1 = m_layers.GetFirst();
|
||||
while (node1)
|
||||
{
|
||||
wxTabLayer *layer = (wxTabLayer *)node1->Data();
|
||||
wxTabLayer *layer = (wxTabLayer *)node1->GetData();
|
||||
int c = 0;
|
||||
wxNode *node2 = layer->First();
|
||||
wxNode *node2 = layer->GetFirst();
|
||||
while (node2)
|
||||
{
|
||||
wxTabControl *cnt = (wxTabControl *)node2->Data();
|
||||
wxTabControl *cnt = (wxTabControl *)node2->GetData();
|
||||
if (cnt == control)
|
||||
{
|
||||
*col = c;
|
||||
return node2;
|
||||
}
|
||||
node2 = node2->Next();
|
||||
node2 = node2->GetNext();
|
||||
c ++;
|
||||
}
|
||||
node1 = node1->Next();
|
||||
node1 = node1->GetNext();
|
||||
}
|
||||
return (wxNode *) NULL;
|
||||
}
|
||||
@@ -1259,7 +1259,7 @@ wxWindow *wxPanelTabView::GetTabWindow(int id) const
|
||||
wxNode *node = m_tabWindows.Find((long)id);
|
||||
if (!node)
|
||||
return (wxWindow *) NULL;
|
||||
return (wxWindow *)node->Data();
|
||||
return (wxWindow *)node->GetData();
|
||||
}
|
||||
|
||||
void wxPanelTabView::ClearWindows(bool deleteWindows)
|
||||
|
@@ -113,8 +113,6 @@ wxBitmapRefData::~wxBitmapRefData()
|
||||
m_bitmapMask = NULL;
|
||||
}
|
||||
|
||||
wxList wxBitmap::sm_handlers;
|
||||
|
||||
#define M_BMPDATA ((wxBitmapRefData *)m_refData)
|
||||
|
||||
wxBitmap::wxBitmap()
|
||||
@@ -138,14 +136,15 @@ wxBitmap::wxBitmap(int w, int h, int d)
|
||||
(void)Create(w, h, d);
|
||||
}
|
||||
|
||||
wxBitmap::wxBitmap(void *data, long type, int width, int height, int depth)
|
||||
wxBitmap::wxBitmap(void *data, wxBitmapType type,
|
||||
int width, int height, int depth)
|
||||
{
|
||||
(void) Create(data, type, width, height, depth);
|
||||
}
|
||||
|
||||
wxBitmap::wxBitmap(const wxString& filename, int type)
|
||||
wxBitmap::wxBitmap(const wxString& filename, wxBitmapType type)
|
||||
{
|
||||
LoadFile(filename, (int)type);
|
||||
LoadFile(filename, type);
|
||||
}
|
||||
|
||||
// Create from XPM data
|
||||
@@ -198,7 +197,7 @@ bool wxBitmap::Create(int w, int h, int d)
|
||||
return M_BITMAPDATA->m_ok;
|
||||
}
|
||||
|
||||
bool wxBitmap::LoadFile(const wxString& filename, long type)
|
||||
bool wxBitmap::LoadFile(const wxString& filename, wxBitmapType type)
|
||||
{
|
||||
UnRef();
|
||||
|
||||
@@ -220,7 +219,8 @@ bool wxBitmap::LoadFile(const wxString& filename, long type)
|
||||
return handler->LoadFile(this, filename, type, -1, -1);
|
||||
}
|
||||
|
||||
bool wxBitmap::Create(void *data, long type, int width, int height, int depth)
|
||||
bool wxBitmap::Create(void *data, wxBitmapType type,
|
||||
int width, int height, int depth)
|
||||
{
|
||||
UnRef();
|
||||
|
||||
@@ -229,7 +229,8 @@ bool wxBitmap::Create(void *data, long type, int width, int height, int depth)
|
||||
wxBitmapHandler *handler = FindHandler(type);
|
||||
|
||||
if ( handler == NULL ) {
|
||||
wxLogWarning("no data bitmap handler for type %ld defined.", type);
|
||||
wxLogWarning("no data bitmap handler for type %ld defined.",
|
||||
(long)type);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@@ -237,7 +238,8 @@ bool wxBitmap::Create(void *data, long type, int width, int height, int depth)
|
||||
return handler->Create(this, data, type, width, height, depth);
|
||||
}
|
||||
|
||||
bool wxBitmap::SaveFile(const wxString& filename, int type, const wxPalette *palette)
|
||||
bool wxBitmap::SaveFile(const wxString& filename, wxBitmapType type,
|
||||
const wxPalette *palette) const
|
||||
{
|
||||
wxBitmapHandler *handler = FindHandler(type);
|
||||
|
||||
@@ -320,68 +322,6 @@ wxBitmap wxBitmap::GetSubBitmap( const wxRect& rect) const
|
||||
return ret;
|
||||
}
|
||||
|
||||
void wxBitmap::AddHandler(wxBitmapHandler *handler)
|
||||
{
|
||||
sm_handlers.Append(handler);
|
||||
}
|
||||
|
||||
void wxBitmap::InsertHandler(wxBitmapHandler *handler)
|
||||
{
|
||||
sm_handlers.Insert(handler);
|
||||
}
|
||||
|
||||
bool wxBitmap::RemoveHandler(const wxString& name)
|
||||
{
|
||||
wxBitmapHandler *handler = FindHandler(name);
|
||||
if ( handler )
|
||||
{
|
||||
sm_handlers.DeleteObject(handler);
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
wxBitmapHandler *wxBitmap::FindHandler(const wxString& name)
|
||||
{
|
||||
wxNode *node = sm_handlers.First();
|
||||
while ( node )
|
||||
{
|
||||
wxBitmapHandler *handler = (wxBitmapHandler *)node->Data();
|
||||
if ( handler->GetName() == name )
|
||||
return handler;
|
||||
node = node->Next();
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
wxBitmapHandler *wxBitmap::FindHandler(const wxString& extension, long bitmapType)
|
||||
{
|
||||
wxNode *node = sm_handlers.First();
|
||||
while ( node )
|
||||
{
|
||||
wxBitmapHandler *handler = (wxBitmapHandler *)node->Data();
|
||||
if ( handler->GetExtension() == extension &&
|
||||
(bitmapType == -1 || handler->GetType() == bitmapType) )
|
||||
return handler;
|
||||
node = node->Next();
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
wxBitmapHandler *wxBitmap::FindHandler(long bitmapType)
|
||||
{
|
||||
wxNode *node = sm_handlers.First();
|
||||
while ( node )
|
||||
{
|
||||
wxBitmapHandler *handler = (wxBitmapHandler *)node->Data();
|
||||
if (handler->GetType() == bitmapType)
|
||||
return handler;
|
||||
node = node->Next();
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* wxMask
|
||||
*/
|
||||
@@ -453,24 +393,6 @@ bool wxMask::Create(const wxBitmap& WXUNUSED(bitmap), const wxColour& WXUNUSED(c
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxBitmapHandler, wxObject)
|
||||
|
||||
bool wxBitmapHandler::Create(wxBitmap *WXUNUSED(bitmap), void *WXUNUSED(data), long WXUNUSED(type),
|
||||
int WXUNUSED(width), int WXUNUSED(height), int WXUNUSED(depth))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool wxBitmapHandler::LoadFile(wxBitmap *WXUNUSED(bitmap), const wxString& WXUNUSED(name), long WXUNUSED(type),
|
||||
int WXUNUSED(desiredWidth), int WXUNUSED(desiredHeight))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool wxBitmapHandler::SaveFile(wxBitmap *WXUNUSED(bitmap), const wxString& WXUNUSED(name), int WXUNUSED(type),
|
||||
const wxPalette *WXUNUSED(palette))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Standard handlers
|
||||
*/
|
||||
@@ -489,10 +411,13 @@ public:
|
||||
virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags,
|
||||
int desiredWidth, int desiredHeight);
|
||||
};
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxXBMFileHandler, wxBitmapHandler)
|
||||
|
||||
bool wxXBMFileHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long WXUNUSED(flags),
|
||||
int WXUNUSED(desiredWidth), int WXUNUSED(desiredHeight))
|
||||
bool wxXBMFileHandler::LoadFile(wxBitmap *bitmap, const wxString& name,
|
||||
long WXUNUSED(flags),
|
||||
int WXUNUSED(desiredWidth),
|
||||
int WXUNUSED(desiredHeight))
|
||||
{
|
||||
M_BITMAPHANDLERDATA->m_freePixmap = TRUE;
|
||||
|
||||
@@ -534,11 +459,13 @@ public:
|
||||
m_type = wxBITMAP_TYPE_XBM_DATA;
|
||||
};
|
||||
|
||||
virtual bool Create(wxBitmap *bitmap, void *data, long flags, int width, int height, int depth = 1);
|
||||
virtual bool Create(wxBitmap *bitmap, void *data, long flags,
|
||||
int width, int height, int depth = 1);
|
||||
};
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxXBMDataHandler, wxBitmapHandler)
|
||||
|
||||
bool wxXBMDataHandler::Create( wxBitmap *bitmap, void *data, long WXUNUSED(flags),
|
||||
bool wxXBMDataHandler::Create( wxBitmap *bitmap, void *data,
|
||||
long WXUNUSED(flags),
|
||||
int width, int height, int WXUNUSED(depth))
|
||||
{
|
||||
M_BITMAPHANDLERDATA->m_width = width;
|
||||
@@ -620,13 +547,16 @@ public:
|
||||
|
||||
virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags,
|
||||
int desiredWidth, int desiredHeight);
|
||||
virtual bool SaveFile(wxBitmap *bitmap, const wxString& name, int type, const wxPalette *palette = NULL);
|
||||
virtual bool SaveFile(const wxBitmap *bitmap, const wxString& name,
|
||||
wxBitmapType type, const wxPalette *palette = NULL);
|
||||
};
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxXPMFileHandler, wxBitmapHandler)
|
||||
|
||||
bool wxXPMFileHandler::LoadFile( wxBitmap *bitmap, const wxString& name, long WXUNUSED(flags),
|
||||
int WXUNUSED(desiredWidth), int WXUNUSED(desiredHeight) )
|
||||
bool wxXPMFileHandler::LoadFile( wxBitmap *bitmap, const wxString& name,
|
||||
long WXUNUSED(flags),
|
||||
int WXUNUSED(desiredWidth),
|
||||
int WXUNUSED(desiredHeight) )
|
||||
{
|
||||
Display *dpy = (Display*) wxGetDisplay();
|
||||
M_BITMAPHANDLERDATA->m_display = (WXDisplay*) dpy;
|
||||
@@ -687,7 +617,8 @@ bool wxXPMFileHandler::LoadFile( wxBitmap *bitmap, const wxString& name, long WX
|
||||
}
|
||||
}
|
||||
|
||||
bool wxXPMFileHandler::SaveFile( wxBitmap *bitmap, const wxString& name, int WXUNUSED(type),
|
||||
bool wxXPMFileHandler::SaveFile( const wxBitmap *bitmap, const wxString& name,
|
||||
wxBitmapType WXUNUSED(type),
|
||||
const wxPalette *WXUNUSED(palette))
|
||||
{
|
||||
if (M_BITMAPHANDLERDATA->m_ok && M_BITMAPHANDLERDATA->m_pixmap)
|
||||
@@ -717,11 +648,13 @@ public:
|
||||
m_type = wxBITMAP_TYPE_XPM_DATA;
|
||||
};
|
||||
|
||||
virtual bool Create(wxBitmap *bitmap, void *data, long flags, int width, int height, int depth = 1);
|
||||
virtual bool Create(wxBitmap *bitmap, void *data, long flags,
|
||||
int width, int height, int depth = 1);
|
||||
};
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxXPMDataHandler, wxBitmapHandler)
|
||||
|
||||
bool wxXPMDataHandler::Create( wxBitmap *bitmap, void *data, long WXUNUSED(flags),
|
||||
bool wxXPMDataHandler::Create( wxBitmap *bitmap, void *data,
|
||||
long WXUNUSED(flags),
|
||||
int width, int height, int WXUNUSED(depth))
|
||||
{
|
||||
M_BITMAPHANDLERDATA->m_width = width;
|
||||
@@ -800,19 +733,6 @@ bool wxXPMDataHandler::Create( wxBitmap *bitmap, void *data, long WXUNUSED(flags
|
||||
|
||||
#endif // wxHAVE_LIB_XPM
|
||||
|
||||
void wxBitmap::CleanUpHandlers()
|
||||
{
|
||||
wxNode *node = sm_handlers.First();
|
||||
while ( node )
|
||||
{
|
||||
wxBitmapHandler *handler = (wxBitmapHandler *)node->Data();
|
||||
wxNode *next = node->Next();
|
||||
delete handler;
|
||||
delete node;
|
||||
node = next;
|
||||
}
|
||||
}
|
||||
|
||||
void wxBitmap::InitStandardHandlers()
|
||||
{
|
||||
// Initialize all standard bitmap or derived class handlers here.
|
||||
|
@@ -51,6 +51,7 @@ ALL_SOURCES = \
|
||||
common/appcmn.cpp \
|
||||
common/artprov.cpp \
|
||||
common/artstd.cpp \
|
||||
common/bmpbase.cpp \
|
||||
common/choiccmn.cpp \
|
||||
common/clipcmn.cpp \
|
||||
common/clntdata.cpp \
|
||||
@@ -631,6 +632,7 @@ COMMONOBJS = \
|
||||
appcmn.o \
|
||||
artprov.o \
|
||||
artstd.o \
|
||||
bmpbase.o \
|
||||
choiccmn.o \
|
||||
clipcmn.o \
|
||||
clntdata.o \
|
||||
|
@@ -169,8 +169,8 @@ bool wxFrame::Create(wxWindow *parent,
|
||||
SetTitle( title );
|
||||
|
||||
wxLogTrace(wxTRACE_Messages,
|
||||
"Created frame (0x%08x) with work area 0x%08x and client "
|
||||
"area 0x%08x", m_mainWidget, m_workArea, m_clientArea);
|
||||
"Created frame (0x%p) with work area 0x%p and client "
|
||||
"area 0x%p", m_mainWidget, m_workArea, m_clientArea);
|
||||
|
||||
XtAddEventHandler((Widget) m_clientArea, ExposureMask,FALSE,
|
||||
wxUniversalRepaintProc, (XtPointer) this);
|
||||
|
@@ -54,11 +54,11 @@ wxIcon::wxIcon(const char **data)
|
||||
(void) Create((void*) data, wxBITMAP_TYPE_XPM_DATA, 0, 0, 0);
|
||||
}
|
||||
|
||||
wxIcon::wxIcon(const wxString& icon_file, long flags,
|
||||
wxIcon::wxIcon(const wxString& icon_file, wxBitmapType type,
|
||||
int desiredWidth, int desiredHeight)
|
||||
|
||||
{
|
||||
LoadFile(icon_file, flags, desiredWidth, desiredHeight);
|
||||
LoadFile(icon_file, type, desiredWidth, desiredHeight);
|
||||
}
|
||||
|
||||
void wxIcon::CopyFromBitmap(const wxBitmap& bmp)
|
||||
@@ -71,7 +71,7 @@ wxIcon::~wxIcon()
|
||||
{
|
||||
}
|
||||
|
||||
bool wxIcon::LoadFile(const wxString& filename, long type,
|
||||
bool wxIcon::LoadFile(const wxString& filename, wxBitmapType type,
|
||||
int desiredWidth, int desiredHeight)
|
||||
{
|
||||
UnRef();
|
||||
@@ -81,7 +81,8 @@ bool wxIcon::LoadFile(const wxString& filename, long type,
|
||||
wxBitmapHandler *handler = FindHandler(type);
|
||||
|
||||
if ( handler )
|
||||
return handler->LoadFile(this, filename, type, desiredWidth, desiredHeight);
|
||||
return handler->LoadFile(this, filename, type,
|
||||
desiredWidth, desiredHeight);
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
@@ -77,10 +77,10 @@ wxPaletteRefData::~wxPaletteRefData()
|
||||
{
|
||||
Display *display = (Display*) NULL;
|
||||
|
||||
wxNode *node, *next;
|
||||
wxList::Node *node, *next;
|
||||
|
||||
for (node = m_palettes.First(); node; node = next) {
|
||||
wxXPalette *c = (wxXPalette *)node->Data();
|
||||
for (node = m_palettes.GetFirst(); node; node = next) {
|
||||
wxXPalette *c = (wxXPalette *)node->GetData();
|
||||
unsigned long *pix_array = c->m_pix_array;
|
||||
Colormap cmap = (Colormap) c->m_cmap;
|
||||
bool destroyable = c->m_destroyable;
|
||||
@@ -103,7 +103,7 @@ wxPaletteRefData::~wxPaletteRefData()
|
||||
if (destroyable)
|
||||
XFreeColormap(display, cmap);
|
||||
|
||||
next = node->Next();
|
||||
next = node->GetNext();
|
||||
m_palettes.DeleteNode(node);
|
||||
delete c;
|
||||
}
|
||||
@@ -189,27 +189,28 @@ bool wxPalette::GetRGB(int index, unsigned char *WXUNUSED(red), unsigned char *W
|
||||
|
||||
WXColormap wxPalette::GetXColormap(WXDisplay* display) const
|
||||
{
|
||||
if (!M_PALETTEDATA || (M_PALETTEDATA->m_palettes.Number() == 0))
|
||||
if (!M_PALETTEDATA || (M_PALETTEDATA->m_palettes.GetCount() == 0))
|
||||
return wxTheApp->GetMainColormap(display);
|
||||
|
||||
wxNode* node = M_PALETTEDATA->m_palettes.First();
|
||||
wxList::Node* node = M_PALETTEDATA->m_palettes.GetFirst();
|
||||
if (!display && node)
|
||||
{
|
||||
wxXPalette* p = (wxXPalette*) node->Data();
|
||||
wxXPalette* p = (wxXPalette*) node->GetData();
|
||||
return p->m_cmap;
|
||||
}
|
||||
while (node)
|
||||
{
|
||||
wxXPalette* p = (wxXPalette*) node->Data();
|
||||
wxXPalette* p = (wxXPalette*) node->GetData();
|
||||
if (p->m_display == display)
|
||||
return p->m_cmap;
|
||||
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
|
||||
/* Make a new one: */
|
||||
wxXPalette *c = new wxXPalette;
|
||||
wxXPalette *first = (wxXPalette *)M_PALETTEDATA->m_palettes.First()->Data();
|
||||
wxXPalette *first =
|
||||
(wxXPalette *)M_PALETTEDATA->m_palettes.GetFirst()->GetData();
|
||||
XColor xcol;
|
||||
int pix_array_n = first->m_pix_array_n;
|
||||
|
||||
@@ -224,9 +225,11 @@ WXColormap wxPalette::GetXColormap(WXDisplay* display) const
|
||||
for (i = 0; i < pix_array_n; i++)
|
||||
{
|
||||
xcol.pixel = first->m_pix_array[i];
|
||||
XQueryColor((Display*) first->m_display, (Colormap) first->m_cmap, &xcol);
|
||||
XQueryColor((Display*) first->m_display,
|
||||
(Colormap) first->m_cmap, &xcol);
|
||||
c->m_pix_array[i] =
|
||||
(XAllocColor((Display*) display, (Colormap) c->m_cmap, &xcol) == 0) ? 0 : xcol.pixel;
|
||||
(XAllocColor((Display*) display, (Colormap) c->m_cmap, &xcol) == 0)
|
||||
? 0 : xcol.pixel;
|
||||
}
|
||||
|
||||
// wxPalette* nonConstThis = (wxPalette*) this;
|
||||
@@ -317,11 +320,12 @@ unsigned long *wxPalette::GetXPixArray(WXDisplay *display, int *n)
|
||||
{
|
||||
if (!M_PALETTEDATA)
|
||||
return (unsigned long*) 0;
|
||||
wxNode *node;
|
||||
wxList::Node *node;
|
||||
|
||||
for (node = M_PALETTEDATA->m_palettes.First(); node; node = node->Next())
|
||||
for (node = M_PALETTEDATA->m_palettes.GetFirst(); node;
|
||||
node = node->GetNext())
|
||||
{
|
||||
wxXPalette *c = (wxXPalette *)node->Data();
|
||||
wxXPalette *c = (wxXPalette *)node->GetData();
|
||||
if (c->m_display == display)
|
||||
{
|
||||
if (n)
|
||||
|
@@ -82,10 +82,10 @@ public:
|
||||
void wxRegionRefData::SetRects(const wxRectList& rectList)
|
||||
{
|
||||
DeleteRects();
|
||||
m_usingRects = (rectList.Number() > 0);
|
||||
m_usingRects = (rectList.GetCount() > 0);
|
||||
if (m_usingRects)
|
||||
{
|
||||
m_rectCount = rectList.Number();
|
||||
m_rectCount = rectList.GetCount();
|
||||
m_rects = new wxRect[m_rectCount];
|
||||
}
|
||||
|
||||
|
@@ -87,7 +87,7 @@ wxTopLevelWindowMotif::~wxTopLevelWindowMotif()
|
||||
SetMainWidget( (WXWidget)0 );
|
||||
|
||||
// If this is the last top-level window, exit.
|
||||
if (wxTheApp && (wxTopLevelWindows.Number() == 0))
|
||||
if (wxTheApp && (wxTopLevelWindows.GetCount() == 0))
|
||||
{
|
||||
wxTheApp->SetTopWindow(NULL);
|
||||
|
||||
|
@@ -961,16 +961,16 @@ void wxWindow::ScrollWindow(int dx, int dy, const wxRect *rect)
|
||||
GetClientSize(& w, & h);
|
||||
}
|
||||
|
||||
wxNode *cnode = m_children.First();
|
||||
wxWindowList::Node *cnode = m_children.GetFirst();
|
||||
while (cnode)
|
||||
{
|
||||
wxWindow *child = (wxWindow*) cnode->Data();
|
||||
wxWindow *child = cnode->GetData();
|
||||
int sx = 0;
|
||||
int sy = 0;
|
||||
child->GetSize( &sx, &sy );
|
||||
wxPoint pos( child->GetPosition() );
|
||||
child->SetSize( pos.x + dx, pos.y + dy, sx, sy, wxSIZE_ALLOW_MINUS_ONE );
|
||||
cnode = cnode->Next();
|
||||
cnode = cnode->GetNext();
|
||||
}
|
||||
|
||||
int x1 = (dx >= 0) ? x : x - dx;
|
||||
@@ -1079,10 +1079,10 @@ void wxWindow::ScrollWindow(int dx, int dy, const wxRect *rect)
|
||||
|
||||
// Now send expose events
|
||||
|
||||
wxNode* node = updateRects.First();
|
||||
wxList::Node* node = updateRects.GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxRect* rect = (wxRect*) node->Data();
|
||||
wxRect* rect = (wxRect*) node->GetData();
|
||||
XExposeEvent event;
|
||||
|
||||
event.type = Expose;
|
||||
@@ -1099,17 +1099,17 @@ void wxWindow::ScrollWindow(int dx, int dy, const wxRect *rect)
|
||||
|
||||
XSendEvent(display, window, False, ExposureMask, (XEvent *)&event);
|
||||
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
|
||||
}
|
||||
|
||||
// Delete the update rects
|
||||
node = updateRects.First();
|
||||
node = updateRects.GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxRect* rect = (wxRect*) node->Data();
|
||||
wxRect* rect = (wxRect*) node->GetData();
|
||||
delete rect;
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
|
||||
XmUpdateDisplay((Widget) GetMainWidget());
|
||||
@@ -1813,8 +1813,8 @@ bool wxAddWindowToTable(Widget w, wxWindow *win)
|
||||
|
||||
wxWidgetHashTable->Put((long) w, win);
|
||||
|
||||
wxLogTrace("widget", "Widget 0x%08x <-> window %p (%s)",
|
||||
w, win, win->GetClassInfo()->GetClassName());
|
||||
wxLogTrace("widget", "Widget 0x%p <-> window %p (%s)",
|
||||
(WXWidget)w, win, win->GetClassInfo()->GetClassName());
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
Reference in New Issue
Block a user