]> git.saurik.com Git - wxWidgets.git/commitdiff
1. wxGrid fixes contributed by Gerhard Gruber (client data for cells...)
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 29 Jun 1999 13:13:11 +0000 (13:13 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 29 Jun 1999 13:13:11 +0000 (13:13 +0000)
2. Motif warnings removed
3. Using native msgbox under Motif (ok, it doesn't work, but generic doesn't
   work neither)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2930 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/generic/gridg.h
include/wx/msgdlg.h
src/generic/gridg.cpp
src/motif/Makefile.am
src/motif/menu.cpp
src/motif/palette.cpp
src/motif/toolbar.cpp
src/motif/utils.cpp

index 81a409bea1c32d893f03cfadbfdd69caa73380cc..01566034322e9916703bcc4c1dd36bce25a633dd 100644 (file)
@@ -2,7 +2,7 @@
 // Name:        gridg.h
 // Purpose:     wxGenericGrid
 // Author:      Julian Smart
 // Name:        gridg.h
 // Purpose:     wxGenericGrid
 // Author:      Julian Smart
-// Modified by: Michael Bedward 
+// Modified by: Michael Bedward
 //                Added edit in place facility, 20 April 1999
 //                Added cursor key control, 29 Jun 1999
 // Created:     01/02/97
 //                Added edit in place facility, 20 April 1999
 //                Added cursor key control, 29 Jun 1999
 // Created:     01/02/97
@@ -101,12 +101,16 @@ public:
     void SetCellTextFont(const wxFont& fnt, int row, int col);
     wxBitmap *GetCellBitmap(int row, int col) const;
     void SetCellBitmap(wxBitmap *bitmap, int row, int col);
     void SetCellTextFont(const wxFont& fnt, int row, int col);
     wxBitmap *GetCellBitmap(int row, int col) const;
     void SetCellBitmap(wxBitmap *bitmap, int row, int col);
+    void *SetCellData(void *data, int row, int col);
+    void *GetCellData(int row, int col);
 
     // Size accessors
     void SetColumnWidth(int col, int width);
     int GetColumnWidth(int col) const;
     void SetRowHeight(int row, int height);
     int GetRowHeight(int row) const;
 
     // Size accessors
     void SetColumnWidth(int col, int width);
     int GetColumnWidth(int col) const;
     void SetRowHeight(int row, int height);
     int GetRowHeight(int row) const;
+    int GetViewHeight() const { return m_viewHeight; }
+    int GetViewWidth() const { return m_viewWidth; }
 
     // Label accessors
     void SetLabelSize(int orientation, int sz);
 
     // Label accessors
     void SetLabelSize(int orientation, int sz);
@@ -266,6 +270,8 @@ protected:
     int                       m_bottomOfSheet;   // Calculated from m_rowHeights
     int                       m_totalGridWidth; // Total 'virtual' size
     int                       m_totalGridHeight;
     int                       m_bottomOfSheet;   // Calculated from m_rowHeights
     int                       m_totalGridWidth; // Total 'virtual' size
     int                       m_totalGridHeight;
+    int                       m_viewHeight;        // Number of rows displayed
+    int                       m_viewWidth;        // Number of columns displayed
     int                       m_cellHeight;      // For now, a default
     int                       m_verticalLabelWidth;
     int                       m_horizontalLabelHeight;
     int                       m_cellHeight;      // For now, a default
     int                       m_verticalLabelWidth;
     int                       m_horizontalLabelHeight;
@@ -318,7 +324,8 @@ public:
     wxColour  backgroundColour;
     wxBrush   backgroundBrush;
     wxBitmap* cellBitmap;
     wxColour  backgroundColour;
     wxBrush   backgroundBrush;
     wxBitmap* cellBitmap;
-    int alignment;
+    void*     cellData;        // intended for additional data associated with a cell
+    int       alignment;
 
     wxGridCell(wxGenericGrid *window = (wxGenericGrid *) NULL);
     ~wxGridCell();
 
     wxGridCell(wxGenericGrid *window = (wxGenericGrid *) NULL);
     ~wxGridCell();
@@ -337,6 +344,9 @@ public:
     void SetAlignment(int align) { alignment = align; }
     wxBitmap *GetCellBitmap() const { return cellBitmap; }
     void SetCellBitmap(wxBitmap *bitmap) { cellBitmap = bitmap; }
     void SetAlignment(int align) { alignment = align; }
     wxBitmap *GetCellBitmap() const { return cellBitmap; }
     void SetCellBitmap(wxBitmap *bitmap) { cellBitmap = bitmap; }
+
+    void *SetCellData(void *data) { void *rc = cellData; cellData = data; return rc; }
+    void *GetCellData() const { return cellData; }
 };
 
 class WXDLLEXPORT wxGrid : public wxGenericGrid
 };
 
 class WXDLLEXPORT wxGrid : public wxGenericGrid
index 0ff9a81129b23e6902ef50226e78c40271eaa5ed..f03456aeaf83f5c3b06f993393a0d9f9815557b5 100644 (file)
@@ -4,7 +4,7 @@
 #if defined(__WXMSW__)
 #include "wx/msw/msgdlg.h"
 #elif defined(__WXMOTIF__)
 #if defined(__WXMSW__)
 #include "wx/msw/msgdlg.h"
 #elif defined(__WXMOTIF__)
-#include "wx/generic/msgdlgg.h"
+#include "wx/motif/msgdlg.h"
 #elif defined(__WXGTK__)
 #include "wx/gtk/msgdlg.h"
 #elif defined(__WXQT__)
 #elif defined(__WXGTK__)
 #include "wx/gtk/msgdlg.h"
 #elif defined(__WXQT__)
index 3f21090c2396ad69ca0d1f7ef3effeb469251b23..5798ad501e2346f77adac3de8397c9871d4874ea 100644 (file)
@@ -5,6 +5,8 @@
 // Modified by: Michael Bedward
 //                Added edit in place facility, 20 Apr 1999
 //                Added cursor key control, 29 Jun 1999
 // Modified by: Michael Bedward
 //                Added edit in place facility, 20 Apr 1999
 //                Added cursor key control, 29 Jun 1999
+//              Gerhard Gruber
+//                Added keyboard navigation, client data, other fixes
 // Created:     04/01/98
 // RCS-ID:      $Id$
 // Copyright:   (c) Julian Smart and Markus Holzem
 // Created:     04/01/98
 // RCS-ID:      $Id$
 // Copyright:   (c) Julian Smart and Markus Holzem
@@ -77,8 +79,10 @@ BEGIN_EVENT_TABLE(wxGenericGrid, wxPanel)
 END_EVENT_TABLE()
 
 
 END_EVENT_TABLE()
 
 
-wxGenericGrid::wxGenericGrid(void)
+wxGenericGrid::wxGenericGrid()
 {
 {
+  m_viewWidth = 0;
+  m_viewHeight = 0;
   m_batchCount = 0;
   m_hScrollBar = (wxScrollBar *) NULL;
   m_vScrollBar = (wxScrollBar *) NULL;
   m_batchCount = 0;
   m_hScrollBar = (wxScrollBar *) NULL;
   m_vScrollBar = (wxScrollBar *) NULL;
@@ -137,9 +141,15 @@ wxGenericGrid::wxGenericGrid(void)
   m_textItem = (wxTextCtrl *) NULL;
 }
 
   m_textItem = (wxTextCtrl *) NULL;
 }
 
-bool wxGenericGrid::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size,
- long style, const wxString& name)
+bool wxGenericGrid::Create(wxWindow *parent,
+                           wxWindowID id,
+                           const wxPoint& pos,
+                           const wxSize& size,
+                           long style,
+                           const wxString& name)
 {
 {
+  m_viewWidth = 0;
+  m_viewHeight = 0;
   m_batchCount = 0;
   m_editingPanel = (wxPanel *) NULL;
   m_hScrollBar = (wxScrollBar *) NULL;
   m_batchCount = 0;
   m_editingPanel = (wxPanel *) NULL;
   m_hScrollBar = (wxScrollBar *) NULL;
@@ -246,12 +256,12 @@ bool wxGenericGrid::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos,
   return TRUE;
 }
 
   return TRUE;
 }
 
-wxGenericGrid::~wxGenericGrid(void)
+wxGenericGrid::~wxGenericGrid()
 {
   ClearGrid();
 }
 
 {
   ClearGrid();
 }
 
-void wxGenericGrid::ClearGrid(void)
+void wxGenericGrid::ClearGrid()
 {
   int i,j;
   if (m_gridCells)
 {
   int i,j;
   if (m_gridCells)
@@ -380,7 +390,7 @@ bool wxGenericGrid::CreateGrid(int nRows, int nCols, wxString **cellValues, shor
 }
 
 // Need to determine various dimensions
 }
 
 // Need to determine various dimensions
-void wxGenericGrid::UpdateDimensions(void)
+void wxGenericGrid::UpdateDimensions()
 {
   int canvasWidth, canvasHeight;
   GetSize(&canvasWidth, &canvasHeight);
 {
   int canvasWidth, canvasHeight;
   GetSize(&canvasWidth, &canvasHeight);
@@ -941,7 +951,7 @@ void wxGenericGrid::DrawCellValue(wxDC *dc, wxRect *rect, int row, int col)
   }
 }
 
   }
 }
 
-void wxGenericGrid::AdjustScrollbars(void)
+void wxGenericGrid::AdjustScrollbars()
 {
   int cw, ch;
   GetClientSize(&cw, &ch);
 {
   int cw, ch;
   GetClientSize(&cw, &ch);
@@ -966,56 +976,53 @@ void wxGenericGrid::AdjustScrollbars(void)
   int noHorizSteps = 0;
   int noVertSteps = 0;
 
   int noHorizSteps = 0;
   int noVertSteps = 0;
 
-  if (m_totalGridWidth + vertScrollBarWidth <= cw)
-    noHorizSteps = 0;
-  else
+  if (m_totalGridWidth + vertScrollBarWidth > cw)
   {
   {
-    noHorizSteps = 0;
     int widthCount = 0;
 
     int i;
     int widthCount = 0;
 
     int i;
-        int nx = 0;
+    int nx = 0;
     for (i = m_scrollPosX ; i < m_totalCols; i++)
     {
       widthCount += m_colWidths[i];
     for (i = m_scrollPosX ; i < m_totalCols; i++)
     {
       widthCount += m_colWidths[i];
-          // A partial bit doesn't count, we still have to scroll to see the
-          // rest of it
+      // A partial bit doesn't count, we still have to scroll to see the
+      // rest of it
       if (widthCount + m_leftOfSheet + m_verticalLabelWidth > (cw-vertScrollBarWidth))
         break;
       if (widthCount + m_leftOfSheet + m_verticalLabelWidth > (cw-vertScrollBarWidth))
         break;
-          else
-               nx ++;
-
+      else
+           nx ++;
     }
 
     noHorizSteps += nx;
   }
     }
 
     noHorizSteps += nx;
   }
-  if (m_totalGridHeight + horizScrollBarHeight <= ch)
-    noVertSteps = 0;
-  else
+  m_viewWidth = noHorizSteps;
+
+  if (m_totalGridHeight + horizScrollBarHeight > ch)
   {
   {
-    noVertSteps = 0;
     int heightCount = 0;
 
     int i;
     int heightCount = 0;
 
     int i;
-        int ny = 0;
+    int ny = 0;
     for (i = m_scrollPosY ; i < m_totalRows; i++)
     {
       heightCount += m_rowHeights[i];
     for (i = m_scrollPosY ; i < m_totalRows; i++)
     {
       heightCount += m_rowHeights[i];
-          // A partial bit doesn't count, we still have to scroll to see the
-          // rest of it
+      // A partial bit doesn't count, we still have to scroll to see the
+      // rest of it
       if (heightCount + m_topOfSheet + m_horizontalLabelHeight > (ch-horizScrollBarHeight))
         break;
       if (heightCount + m_topOfSheet + m_horizontalLabelHeight > (ch-horizScrollBarHeight))
         break;
-          else
-            ny ++;
+      else
+        ny ++;
     }
 
     noVertSteps += ny;
   }
 
     }
 
     noVertSteps += ny;
   }
 
+  m_viewHeight = noVertSteps;
+
   if (m_totalGridWidth + vertScrollBarWidth <= cw)
   {
   if (m_totalGridWidth + vertScrollBarWidth <= cw)
   {
-        if ( m_hScrollBar )
-            m_hScrollBar->Show(FALSE);
+    if ( m_hScrollBar )
+        m_hScrollBar->Show(FALSE);
     SetScrollPosX(0);
   }
   else
     SetScrollPosX(0);
   }
   else
@@ -1479,12 +1486,12 @@ void wxGenericGrid::OnSelectCellImplementation(wxDC *dc, int row, int col)
   GetEventHandler()->ProcessEvent(g_evt2);
 }
 
   GetEventHandler()->ProcessEvent(g_evt2);
 }
 
-wxGridCell *wxGenericGrid::OnCreateCell(void)
+wxGridCell *wxGenericGrid::OnCreateCell()
 {
   return new wxGridCell(this);
 }
 
 {
   return new wxGridCell(this);
 }
 
-void wxGenericGrid::OnChangeLabels(void)
+void wxGenericGrid::OnChangeLabels()
 {
   char buf[100];
   int i;
 {
   char buf[100];
   int i;
@@ -1510,7 +1517,7 @@ void wxGenericGrid::OnChangeLabels(void)
   }
 }
 
   }
 }
 
-void wxGenericGrid::OnChangeSelectionLabel(void)
+void wxGenericGrid::OnChangeSelectionLabel()
 {
   if (!GetEditable())
     return;
 {
   if (!GetEditable())
     return;
@@ -1553,7 +1560,7 @@ void wxGenericGrid::HighlightCell(wxDC *dc)
   dc->SetLogicalFunction(wxCOPY);
 }
 
   dc->SetLogicalFunction(wxCOPY);
 }
 
-void wxGenericGrid::DrawCellText(void)
+void wxGenericGrid::DrawCellText()
 {
   if (!m_currentRectVisible)
     return;
 {
   if (!m_currentRectVisible)
     return;
@@ -2510,9 +2517,9 @@ void wxGenericGrid::SetGridCursor(int row, int col)
   dc.EndDrawing();
 }
 
   dc.EndDrawing();
 }
 
-/*
- * Grid cell
- */
+// ----------------------------------------------------------------------------
+// Grid cell
+// ----------------------------------------------------------------------------
 
 wxGridCell::wxGridCell(wxGenericGrid *window)
 {
 
 wxGridCell::wxGridCell(wxGenericGrid *window)
 {
@@ -2539,9 +2546,11 @@ wxGridCell::wxGridCell(wxGenericGrid *window)
     alignment = window->GetCellAlignment();
   else
     alignment = wxLEFT;
     alignment = window->GetCellAlignment();
   else
     alignment = wxLEFT;
+
+  cellData = (void *)NULL;
 }
 
 }
 
-wxGridCell::~wxGridCell(void)
+wxGridCell::~wxGridCell()
 {
 }
 
 {
 }
 
@@ -2741,4 +2750,25 @@ void wxGenericGrid::_OnLabelRightClick(wxGridEvent& ev)
     OnLabelRightClick(ev.m_row, ev.m_col, ev.m_x, ev.m_y, ev.m_control, ev.m_shift);
 }
 
     OnLabelRightClick(ev.m_row, ev.m_col, ev.m_x, ev.m_y, ev.m_control, ev.m_shift);
 }
 
+void *wxGenericGrid::SetCellData(void *data, int row, int col)
+{
+    void *rc = NULL;
+
+    wxGridCell *cell = GetCell(row, col);
+    if ( cell )
+        rc = cell->SetCellData(data);
+
+    return rc;
+}
+
+void *wxGenericGrid::GetCellData(int row, int col)
+{
+    void *rc = NULL;
+
+    wxGridCell *cell = GetCell(row, col);
+    if ( cell )
+        rc = cell->GetCellData();
+
+    return rc;
+}
 
 
index f920cecc9e6cc8a38dff9b39a3965c43db116dd0..9f05f9e07190e62e08fe1be1529f8641537be47c 100644 (file)
@@ -118,7 +118,6 @@ libwx_motif_la_SOURCES = \
  imaglist.cpp \
  laywin.cpp \
  listctrl.cpp \
  imaglist.cpp \
  laywin.cpp \
  listctrl.cpp \
- msgdlgg.cpp \
  panelg.cpp \
  printps.cpp \
  prntdlgg.cpp \
  panelg.cpp \
  printps.cpp \
  prntdlgg.cpp \
@@ -170,6 +169,7 @@ libwx_motif_la_SOURCES = \
  menu.cpp \
  menuitem.cpp \
  minifram.cpp \
  menu.cpp \
  menuitem.cpp \
  minifram.cpp \
+ msgdlg.cpp \
  notebook.cpp \
  palette.cpp \
  pen.cpp \
  notebook.cpp \
  palette.cpp \
  pen.cpp \
index b940cce13365d24b49baf4170fd8090168217cfd..5dcec13e488ddc9c6edb1a4c9125ca47f128e585 100644 (file)
@@ -6,7 +6,7 @@
 // Created:     17/09/98
 // RCS-ID:      $Id$
 // Copyright:   (c) Julian Smart
 // Created:     17/09/98
 // RCS-ID:      $Id$
 // Copyright:   (c) Julian Smart
-// Licence:    wxWindows licence
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 
 /////////////////////////////////////////////////////////////////////////////
 
 
@@ -66,7 +66,7 @@ wxMenu::wxMenu(const wxString& title, const wxFunction func)
     m_noItems = 0;
     m_menuBar = NULL;
     m_pInvokingWindow = NULL;
     m_noItems = 0;
     m_menuBar = NULL;
     m_pInvokingWindow = NULL;
-    
+
     //// Motif-specific members
     m_numColumns = 1;
     m_menuWidget = (WXWidget) NULL;
     //// Motif-specific members
     m_numColumns = 1;
     m_menuWidget = (WXWidget) NULL;
@@ -77,7 +77,7 @@ wxMenu::wxMenu(const wxString& title, const wxFunction func)
     m_ownedByMenuBar = FALSE;
     m_menuParent = (wxMenu*) NULL;
     m_clientData = (void*) NULL;
     m_ownedByMenuBar = FALSE;
     m_menuParent = (wxMenu*) NULL;
     m_clientData = (void*) NULL;
-    
+
     if (m_title != "")
     {
         Append(ID_SEPARATOR, m_title) ;
     if (m_title != "")
     {
         Append(ID_SEPARATOR, m_title) ;
@@ -86,7 +86,7 @@ wxMenu::wxMenu(const wxString& title, const wxFunction func)
     m_backgroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_MENU);
     m_foregroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_MENUTEXT);
     m_font = wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT);
     m_backgroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_MENU);
     m_foregroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_MENUTEXT);
     m_font = wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT);
-    
+
     Callback(func);
 }
 
     Callback(func);
 }
 
@@ -100,24 +100,24 @@ wxMenu::~wxMenu()
         else
             DestroyMenu(FALSE);
     }
         else
             DestroyMenu(FALSE);
     }
-    
+
     // Not sure if this is right
     if (m_menuParent && m_menuBar)
     {
         m_menuParent = NULL;
         //      m_menuBar = NULL;
     }
     // Not sure if this is right
     if (m_menuParent && m_menuBar)
     {
         m_menuParent = NULL;
         //      m_menuBar = NULL;
     }
-    
+
     wxNode *node = m_menuItems.First();
     while (node)
     {
         wxMenuItem *item = (wxMenuItem *)node->Data();
     wxNode *node = m_menuItems.First();
     while (node)
     {
         wxMenuItem *item = (wxMenuItem *)node->Data();
-        
+
         /*
         if (item->GetSubMenu())
         item->DeleteSubMenu();
         */
         /*
         if (item->GetSubMenu())
         item->DeleteSubMenu();
         */
-        
+
         wxNode *next = node->Next();
         delete item;
         delete node;
         wxNode *next = node->Next();
         delete item;
         delete node;
@@ -134,12 +134,12 @@ void wxMenu::Break()
 void wxMenu::Append(wxMenuItem *pItem)
 {
     wxCHECK_RET( pItem != NULL, "can't append NULL item to the menu" );
 void wxMenu::Append(wxMenuItem *pItem)
 {
     wxCHECK_RET( pItem != NULL, "can't append NULL item to the menu" );
-    
+
     m_menuItems.Append(pItem);
     m_menuItems.Append(pItem);
-    
+
     if (m_menuWidget)
     if (m_menuWidget)
-        pItem->CreateItem (m_menuWidget, m_menuBar, m_topLevelMenu);   // this is a dynamic Append
-    
+        pItem->CreateItem (m_menuWidget, m_menuBar, m_topLevelMenu); // this is a dynamic Append
+
     m_noItems++;
 }
 
     m_noItems++;
 }
 
@@ -154,16 +154,16 @@ void wxMenu::AppendSeparator()
 // as well as in m_menuItems, whereas we only store it in
 // m_menuItems here. What implications does this have?
 
 // as well as in m_menuItems, whereas we only store it in
 // m_menuItems here. What implications does this have?
 
-void wxMenu::Append(int id, const wxString& label, wxMenu *subMenu, 
+void wxMenu::Append(int id, const wxString& label, wxMenu *subMenu,
                     const wxString& helpString)
 {
     Append(new wxMenuItem(this, id, label, helpString, FALSE, subMenu));
                     const wxString& helpString)
 {
     Append(new wxMenuItem(this, id, label, helpString, FALSE, subMenu));
-    
+
     subMenu->m_topLevelMenu = m_topLevelMenu;
 }
 
 // Ordinary menu item
     subMenu->m_topLevelMenu = m_topLevelMenu;
 }
 
 // Ordinary menu item
-void wxMenu::Append(int id, const wxString& label, 
+void wxMenu::Append(int id, const wxString& label,
                     const wxString& helpString, bool checkable)
 {
     // 'checkable' parameter is useless for Windows.
                     const wxString& helpString, bool checkable)
 {
     // 'checkable' parameter is useless for Windows.
@@ -175,19 +175,19 @@ void wxMenu::Delete(int id)
     wxNode *node;
     wxMenuItem *item;
     int pos;
     wxNode *node;
     wxMenuItem *item;
     int pos;
-    
-    for (pos = 0, node = m_menuItems.First(); node; node = node->Next(), pos++) 
+
+    for (pos = 0, node = m_menuItems.First(); node; node = node->Next(), pos++)
     {
         item = (wxMenuItem *)node->Data();
         if (item->GetId() == id)
             break;
     }
     {
         item = (wxMenuItem *)node->Data();
         if (item->GetId() == id)
             break;
     }
-    
+
     if (!node)
         return;
     if (!node)
         return;
-    
+
     item->DestroyItem(TRUE);
     item->DestroyItem(TRUE);
-    
+
     // See also old code - don't know if this is needed (seems redundant).
     /*
     if (item->GetSubMenu()) {
     // See also old code - don't know if this is needed (seems redundant).
     /*
     if (item->GetSubMenu()) {
@@ -196,7 +196,7 @@ void wxMenu::Delete(int id)
     children->DeleteObject(item->GetSubMenu());
     }
     */
     children->DeleteObject(item->GetSubMenu());
     }
     */
-    
+
     m_menuItems.DeleteNode(node);
     delete item;
 }
     m_menuItems.DeleteNode(node);
     delete item;
 }
@@ -205,7 +205,7 @@ void wxMenu::Enable(int id, bool flag)
 {
     wxMenuItem *item = FindItemForId(id);
     wxCHECK_RET( item != NULL, "can't enable non-existing menu item" );
 {
     wxMenuItem *item = FindItemForId(id);
     wxCHECK_RET( item != NULL, "can't enable non-existing menu item" );
-    
+
     item->Enable(flag);
 }
 
     item->Enable(flag);
 }
 
@@ -213,7 +213,7 @@ bool wxMenu::Enabled(int Id) const
 {
     wxMenuItem *item = FindItemForId(Id);
     wxCHECK( item != NULL, FALSE );
 {
     wxMenuItem *item = FindItemForId(Id);
     wxCHECK( item != NULL, FALSE );
-    
+
     return item->IsEnabled();
 }
 
     return item->IsEnabled();
 }
 
@@ -221,7 +221,7 @@ void wxMenu::Check(int Id, bool Flag)
 {
     wxMenuItem *item = FindItemForId(Id);
     wxCHECK_RET( item != NULL, "can't get status of non-existing menu item" );
 {
     wxMenuItem *item = FindItemForId(Id);
     wxCHECK_RET( item != NULL, "can't get status of non-existing menu item" );
-    
+
     item->Check(Flag);
 }
 
     item->Check(Flag);
 }
 
@@ -229,23 +229,23 @@ bool wxMenu::Checked(int id) const
 {
     wxMenuItem *item = FindItemForId(id);
     wxCHECK( item != NULL, FALSE );
 {
     wxMenuItem *item = FindItemForId(id);
     wxCHECK( item != NULL, FALSE );
-    
+
     return item->IsChecked();
 }
 
 void wxMenu::SetTitle(const wxString& label)
 {
     m_title = label ;
     return item->IsChecked();
 }
 
 void wxMenu::SetTitle(const wxString& label)
 {
     m_title = label ;
-    
+
     wxNode *node = m_menuItems.First ();
     if (!node)
         return;
     wxNode *node = m_menuItems.First ();
     if (!node)
         return;
-    
+
     wxMenuItem *item = (wxMenuItem *) node->Data ();
     Widget widget = (Widget) item->GetButtonWidget();
     if (!widget)
         return;
     wxMenuItem *item = (wxMenuItem *) node->Data ();
     Widget widget = (Widget) item->GetButtonWidget();
     if (!widget)
         return;
-    
+
     XmString title_str = XmStringCreateSimple ((char*) (const char*) label);
     XtVaSetValues (widget,
         XmNlabelString, title_str,
     XmString title_str = XmStringCreateSimple ((char*) (const char*) label);
     XtVaSetValues (widget,
         XmNlabelString, title_str,
@@ -263,7 +263,7 @@ void wxMenu::SetLabel(int id, const wxString& label)
     wxMenuItem *item = FindItemForId(id);
     if (item == (wxMenuItem*) NULL)
         return;
     wxMenuItem *item = FindItemForId(id);
     if (item == (wxMenuItem*) NULL)
         return;
-    
+
     item->SetLabel(label);
 }
 
     item->SetLabel(label);
 }
 
@@ -278,7 +278,7 @@ wxString wxMenu::GetLabel(int id) const
         XtVaGetValues ((Widget) w,
             XmNlabelString, &text,
             NULL);
         XtVaGetValues ((Widget) w,
             XmNlabelString, &text,
             NULL);
-        
+
         if (XmStringGetLtoR (text, XmSTRING_DEFAULT_CHARSET, &s))
         {
             wxString str(s);
         if (XmStringGetLtoR (text, XmSTRING_DEFAULT_CHARSET, &s))
         {
             wxString str(s);
@@ -301,7 +301,7 @@ int wxMenu::FindItem (const wxString& itemString) const
     char buf1[200];
     char buf2[200];
     wxStripMenuCodes ((char *)(const char *)itemString, buf1);
     char buf1[200];
     char buf2[200];
     wxStripMenuCodes ((char *)(const char *)itemString, buf1);
-    
+
     for (wxNode * node = m_menuItems.First (); node; node = node->Next ())
     {
         wxMenuItem *item = (wxMenuItem *) node->Data ();
     for (wxNode * node = m_menuItems.First (); node; node = node->Next ())
     {
         wxMenuItem *item = (wxMenuItem *) node->Data ();
@@ -318,7 +318,7 @@ int wxMenu::FindItem (const wxString& itemString) const
                 return item->GetId();
         }
     }
                 return item->GetId();
         }
     }
-    
+
     return -1;
 }
 
     return -1;
 }
 
@@ -329,14 +329,14 @@ wxMenuItem *wxMenu::FindItemForId(int itemId, wxMenu ** itemMenu) const
     for (wxNode * node = m_menuItems.First (); node; node = node->Next ())
     {
         wxMenuItem *item = (wxMenuItem *) node->Data ();
     for (wxNode * node = m_menuItems.First (); node; node = node->Next ())
     {
         wxMenuItem *item = (wxMenuItem *) node->Data ();
-        
+
         if (item->GetId() == itemId)
         {
             if (itemMenu)
                 *itemMenu = (wxMenu *) this;
             return item;
         }
         if (item->GetId() == itemId)
         {
             if (itemMenu)
                 *itemMenu = (wxMenu *) this;
             return item;
         }
-        
+
         if (item->GetSubMenu())
         {
             wxMenuItem *ans = item->GetSubMenu()->FindItemForId (itemId, itemMenu);
         if (item->GetSubMenu())
         {
             wxMenuItem *ans = item->GetSubMenu()->FindItemForId (itemId, itemMenu);
@@ -344,7 +344,7 @@ wxMenuItem *wxMenu::FindItemForId(int itemId, wxMenu ** itemMenu) const
                 return ans;
         }
     }
                 return ans;
         }
     }
-    
+
     if (itemMenu)
         *itemMenu = NULL;
     return NULL;
     if (itemMenu)
         *itemMenu = NULL;
     return NULL;
@@ -367,14 +367,14 @@ wxString wxMenu::GetHelpString (int itemId) const
 void wxMenu::ProcessCommand(wxCommandEvent & event)
 {
     bool processed = FALSE;
 void wxMenu::ProcessCommand(wxCommandEvent & event)
 {
     bool processed = FALSE;
-    
+
     // Try a callback
     if (m_callback)
     {
         (void) (*(m_callback)) (*this, event);
         processed = TRUE;
     }
     // Try a callback
     if (m_callback)
     {
         (void) (*(m_callback)) (*this, event);
         processed = TRUE;
     }
-    
+
     // Try the menu's event handler
     if ( !processed && GetEventHandler())
     {
     // Try the menu's event handler
     if ( !processed && GetEventHandler())
     {
@@ -429,23 +429,21 @@ void wxMenu::UpdateUI(wxEvtHandler* source)
 bool wxWindow::PopupMenu(wxMenu *menu, int x, int y)
 {
     Widget widget = (Widget) GetMainWidget();
 bool wxWindow::PopupMenu(wxMenu *menu, int x, int y)
 {
     Widget widget = (Widget) GetMainWidget();
-    
+
     /* The menuId field seems to be usused, so we'll use it to
     indicate whether a menu is popped up or not:
     0: Not currently created as a popup
     -1: Created as a popup, but not active
     1: Active popup.
     */
     /* The menuId field seems to be usused, so we'll use it to
     indicate whether a menu is popped up or not:
     0: Not currently created as a popup
     -1: Created as a popup, but not active
     1: Active popup.
     */
-    
+
     if (menu->GetParent() && (menu->GetId() != -1))
         return FALSE;
     if (menu->GetParent() && (menu->GetId() != -1))
         return FALSE;
-    
+
     if (menu->GetMainWidget()) {
         menu->DestroyMenu(TRUE);
     }
     if (menu->GetMainWidget()) {
         menu->DestroyMenu(TRUE);
     }
-    
-    wxWindow *parent = this;
-    
+
     menu->SetId(1); /* Mark as popped-up */
     menu->CreateMenu(NULL, widget, menu);
     menu->SetInvokingWindow(this);
     menu->SetId(1); /* Mark as popped-up */
     menu->CreateMenu(NULL, widget, menu);
     menu->SetInvokingWindow(this);
@@ -454,12 +452,12 @@ bool wxWindow::PopupMenu(wxMenu *menu, int x, int y)
 
     //  menu->SetParent(parent);
     //  parent->children->Append(menu);  // Store menu for later deletion
 
     //  menu->SetParent(parent);
     //  parent->children->Append(menu);  // Store menu for later deletion
-    
+
     Widget menuWidget = (Widget) menu->GetMainWidget();
     Widget menuWidget = (Widget) menu->GetMainWidget();
-    
+
     int rootX = 0;
     int rootY = 0;
     int rootX = 0;
     int rootY = 0;
-    
+
     int deviceX = x;
     int deviceY = y;
     /*
     int deviceX = x;
     int deviceY = y;
     /*
@@ -470,27 +468,27 @@ bool wxWindow::PopupMenu(wxMenu *menu, int x, int y)
     deviceY = canvas->GetDC ()->LogicalToDeviceY (y);
     }
     */
     deviceY = canvas->GetDC ()->LogicalToDeviceY (y);
     }
     */
-    
+
     Display *display = XtDisplay (widget);
     Window rootWindow = RootWindowOfScreen (XtScreen((Widget)widget));
     Window thisWindow = XtWindow (widget);
     Window childWindow;
     XTranslateCoordinates (display, thisWindow, rootWindow, (int) deviceX, (int) deviceY,
         &rootX, &rootY, &childWindow);
     Display *display = XtDisplay (widget);
     Window rootWindow = RootWindowOfScreen (XtScreen((Widget)widget));
     Window thisWindow = XtWindow (widget);
     Window childWindow;
     XTranslateCoordinates (display, thisWindow, rootWindow, (int) deviceX, (int) deviceY,
         &rootX, &rootY, &childWindow);
-    
+
     XButtonPressedEvent event;
     event.type = ButtonPress;
     event.button = 1;
     XButtonPressedEvent event;
     event.type = ButtonPress;
     event.button = 1;
-    
+
     event.x = deviceX;
     event.y = deviceY;
     event.x = deviceX;
     event.y = deviceY;
-    
+
     event.x_root = rootX;
     event.y_root = rootY;
     event.x_root = rootX;
     event.y_root = rootY;
-    
+
     XmMenuPosition (menuWidget, &event);
     XtManageChild (menuWidget);
     XmMenuPosition (menuWidget, &event);
     XtManageChild (menuWidget);
-    
+
     return TRUE;
 }
 
     return TRUE;
 }
 
@@ -571,10 +569,10 @@ void wxMenuBar::Check(int id, bool flag)
     wxMenuItem *item = FindItemForId(id, &itemMenu) ;
     if (!item)
         return;
     wxMenuItem *item = FindItemForId(id, &itemMenu) ;
     if (!item)
         return;
-    
+
     if (!item->IsCheckable())
         return ;
     if (!item->IsCheckable())
         return ;
-    
+
     item->Check(flag);
 }
 
     item->Check(flag);
 }
 
@@ -584,7 +582,7 @@ bool wxMenuBar::Checked(int id) const
     wxMenuItem *item = FindItemForId(id, &itemMenu) ;
     if (!item)
         return FALSE;
     wxMenuItem *item = FindItemForId(id, &itemMenu) ;
     if (!item)
         return FALSE;
-    
+
     return item->IsChecked();
 }
 
     return item->IsChecked();
 }
 
@@ -594,7 +592,7 @@ bool wxMenuBar::Enabled(int id) const
     wxMenuItem *item = FindItemForId(id, &itemMenu) ;
     if (!item)
         return FALSE;
     wxMenuItem *item = FindItemForId(id, &itemMenu) ;
     if (!item)
         return FALSE;
-    
+
     return item->IsEnabled();
 }
 
     return item->IsEnabled();
 }
 
@@ -602,10 +600,10 @@ void wxMenuBar::SetLabel(int id, const wxString& label)
 {
     wxMenu *itemMenu = NULL;
     wxMenuItem *item = FindItemForId(id, &itemMenu) ;
 {
     wxMenu *itemMenu = NULL;
     wxMenuItem *item = FindItemForId(id, &itemMenu) ;
-    
+
     if (!item)
         return;
     if (!item)
         return;
-    
+
     item->SetLabel(label);
 }
 
     item->SetLabel(label);
 }
 
@@ -613,17 +611,17 @@ wxString wxMenuBar::GetLabel(int id) const
 {
     wxMenu *itemMenu = NULL;
     wxMenuItem *item = FindItemForId(id, &itemMenu) ;
 {
     wxMenu *itemMenu = NULL;
     wxMenuItem *item = FindItemForId(id, &itemMenu) ;
-    
+
     if (!item)
         return wxString("");
     if (!item)
         return wxString("");
-    
+
     return item->GetLabel();
 }
 
 void wxMenuBar::SetLabelTop(int pos, const wxString& label)
 {
     wxASSERT( (pos < m_menuCount) );
     return item->GetLabel();
 }
 
 void wxMenuBar::SetLabelTop(int pos, const wxString& label)
 {
     wxASSERT( (pos < m_menuCount) );
-    
+
     Widget w = (Widget) m_menus[pos]->GetButtonWidget();
     if (w)
     {
     Widget w = (Widget) m_menus[pos]->GetButtonWidget();
     if (w)
     {
@@ -638,7 +636,7 @@ void wxMenuBar::SetLabelTop(int pos, const wxString& label)
 wxString wxMenuBar::GetLabelTop(int pos) const
 {
     wxASSERT( (pos < m_menuCount) );
 wxString wxMenuBar::GetLabelTop(int pos) const
 {
     wxASSERT( (pos < m_menuCount) );
-    
+
     Widget w = (Widget) m_menus[pos]->GetButtonWidget();
     if (w)
     {
     Widget w = (Widget) m_menus[pos]->GetButtonWidget();
     if (w)
     {
@@ -647,7 +645,7 @@ wxString wxMenuBar::GetLabelTop(int pos) const
         XtVaGetValues (w,
             XmNlabelString, &text,
             NULL);
         XtVaGetValues (w,
             XmNlabelString, &text,
             NULL);
-        
+
         if (XmStringGetLtoR (text, XmSTRING_DEFAULT_CHARSET, &s))
         {
             wxString str(s);
         if (XmStringGetLtoR (text, XmSTRING_DEFAULT_CHARSET, &s))
         {
             wxString str(s);
@@ -661,7 +659,7 @@ wxString wxMenuBar::GetLabelTop(int pos) const
     }
     else
         return wxEmptyString;
     }
     else
         return wxEmptyString;
-    
+
 }
 
 bool wxMenuBar::OnDelete(wxMenu *menu, int pos)
 }
 
 bool wxMenuBar::OnDelete(wxMenu *menu, int pos)
@@ -669,7 +667,7 @@ bool wxMenuBar::OnDelete(wxMenu *menu, int pos)
     // Only applies to dynamic deletion (when set in frame)
     if (!m_menuBarFrame)
         return TRUE;
     // Only applies to dynamic deletion (when set in frame)
     if (!m_menuBarFrame)
         return TRUE;
-    
+
     menu->DestroyMenu(TRUE);
     return TRUE;
 }
     menu->DestroyMenu(TRUE);
     return TRUE;
 }
@@ -679,18 +677,18 @@ bool wxMenuBar::OnAppend(wxMenu *menu, const char *title)
     // Only applies to dynamic append (when set in frame)
     if (!m_menuBarFrame)
         return TRUE;
     // Only applies to dynamic append (when set in frame)
     if (!m_menuBarFrame)
         return TRUE;
-    
+
     // Probably should be an assert here
     if (menu->GetParent())
         return FALSE;
     // Probably should be an assert here
     if (menu->GetParent())
         return FALSE;
-    
+
     // Has already been appended
     if (menu->GetButtonWidget())
         return FALSE;
     // Has already been appended
     if (menu->GetButtonWidget())
         return FALSE;
-    
+
     WXWidget w = menu->CreateMenu(this, GetMainWidget(), menu, title, TRUE);
     menu->SetButtonWidget(w);
     WXWidget w = menu->CreateMenu(this, GetMainWidget(), menu, title, TRUE);
     menu->SetButtonWidget(w);
-    
+
     return TRUE;
 }
 
     return TRUE;
 }
 
@@ -698,12 +696,12 @@ void wxMenuBar::Append (wxMenu * menu, const wxString& title)
 {
     if (!OnAppend(menu, title))
         return;
 {
     if (!OnAppend(menu, title))
         return;
-    
+
     m_menuCount ++;
     wxMenu **new_menus = new wxMenu *[m_menuCount];
     wxString *new_titles = new wxString[m_menuCount];
     int i;
     m_menuCount ++;
     wxMenu **new_menus = new wxMenu *[m_menuCount];
     wxString *new_titles = new wxString[m_menuCount];
     int i;
-    
+
     for (i = 0; i < m_menuCount - 1; i++)
     {
         new_menus[i] = m_menus[i];
     for (i = 0; i < m_menuCount - 1; i++)
     {
         new_menus[i] = m_menus[i];
@@ -718,10 +716,10 @@ void wxMenuBar::Append (wxMenu * menu, const wxString& title)
     }
     m_menus = new_menus;
     m_titles = new_titles;
     }
     m_menus = new_menus;
     m_titles = new_titles;
-    
+
     m_menus[m_menuCount - 1] = (wxMenu *)menu;
     m_titles[m_menuCount - 1] = title;
     m_menus[m_menuCount - 1] = (wxMenu *)menu;
     m_titles[m_menuCount - 1] = title;
-    
+
     menu->SetMenuBar(this);
     menu->SetParent(this);
 }
     menu->SetMenuBar(this);
     menu->SetParent(this);
 }
@@ -730,7 +728,7 @@ void wxMenuBar::Delete(wxMenu * menu, int i)
 {
     int j;
     int ii = (int) i;
 {
     int j;
     int ii = (int) i;
-    
+
     if (menu != 0)
     {
         for (ii = 0; ii < m_menuCount; ii++)
     if (menu != 0)
     {
         for (ii = 0; ii < m_menuCount; ii++)
@@ -746,12 +744,12 @@ void wxMenuBar::Delete(wxMenu * menu, int i)
             return;
         menu = m_menus[ii];
     }
             return;
         menu = m_menus[ii];
     }
-    
+
     if (!OnDelete(menu, ii))
         return;
     if (!OnDelete(menu, ii))
         return;
-    
+
     menu->SetParent((wxEvtHandler*) NULL);
     menu->SetParent((wxEvtHandler*) NULL);
-    
+
     -- m_menuCount;
     for (j = ii; j < m_menuCount; j++)
     {
     -- m_menuCount;
     for (j = ii; j < m_menuCount; j++)
     {
@@ -781,7 +779,7 @@ wxMenuItem *wxMenuBar::FindItemForId (int id, wxMenu ** itemMenu) const
 {
     if (itemMenu)
         *itemMenu = NULL;
 {
     if (itemMenu)
         *itemMenu = NULL;
-    
+
     wxMenuItem *item = NULL;
     int i;
     for (i = 0; i < m_menuCount; i++)
     wxMenuItem *item = NULL;
     int i;
     for (i = 0; i < m_menuCount; i++)
@@ -827,35 +825,35 @@ bool wxMenuBar::CreateMenuBar(wxFrame* parent)
         XtMapWidget((Widget) m_mainWidget);
         return TRUE;
     }
         XtMapWidget((Widget) m_mainWidget);
         return TRUE;
     }
-    
+
     Widget menuBarW = XmCreateMenuBar ((Widget) parent->GetMainWindowWidget(), "MenuBar", NULL, 0);
     m_mainWidget = (WXWidget) menuBarW;
     Widget menuBarW = XmCreateMenuBar ((Widget) parent->GetMainWindowWidget(), "MenuBar", NULL, 0);
     m_mainWidget = (WXWidget) menuBarW;
-    
+
     int i;
     for (i = 0; i < GetMenuCount(); i++)
     {
         wxMenu *menu = GetMenu(i);
         wxString title(m_titles[i]);
         menu->SetButtonWidget(menu->CreateMenu (this, menuBarW, menu, title, TRUE));
     int i;
     for (i = 0; i < GetMenuCount(); i++)
     {
         wxMenu *menu = GetMenu(i);
         wxString title(m_titles[i]);
         menu->SetButtonWidget(menu->CreateMenu (this, menuBarW, menu, title, TRUE));
-        
+
         /*
         * COMMENT THIS OUT IF YOU DON'T LIKE A RIGHT-JUSTIFIED HELP MENU
         */
         wxStripMenuCodes ((char*) (const char*) title, wxBuffer);
         /*
         * COMMENT THIS OUT IF YOU DON'T LIKE A RIGHT-JUSTIFIED HELP MENU
         */
         wxStripMenuCodes ((char*) (const char*) title, wxBuffer);
-        
+
         if (strcmp (wxBuffer, "Help") == 0)
             XtVaSetValues ((Widget) menuBarW, XmNmenuHelpWidget, (Widget) menu->GetButtonWidget(), NULL);
     }
         if (strcmp (wxBuffer, "Help") == 0)
             XtVaSetValues ((Widget) menuBarW, XmNmenuHelpWidget, (Widget) menu->GetButtonWidget(), NULL);
     }
-    
+
     SetBackgroundColour(m_backgroundColour);
     SetForegroundColour(m_foregroundColour);
     SetFont(m_font);
     SetBackgroundColour(m_backgroundColour);
     SetForegroundColour(m_foregroundColour);
     SetFont(m_font);
-    
+
     XtVaSetValues((Widget) parent->GetMainWindowWidget(), XmNmenuBar, (Widget) m_mainWidget, NULL);
     XtRealizeWidget ((Widget) menuBarW);
     XtManageChild ((Widget) menuBarW);
     SetMenuBarFrame(parent);
     XtVaSetValues((Widget) parent->GetMainWindowWidget(), XmNmenuBar, (Widget) m_mainWidget, NULL);
     XtRealizeWidget ((Widget) menuBarW);
     XtManageChild ((Widget) menuBarW);
     SetMenuBarFrame(parent);
-    
+
     return TRUE;
 }
 
     return TRUE;
 }
 
@@ -867,22 +865,22 @@ bool wxMenuBar::DestroyMenuBar()
         SetMenuBarFrame((wxFrame*) NULL);
         return FALSE;
     }
         SetMenuBarFrame((wxFrame*) NULL);
         return FALSE;
     }
-    
+
     XtUnmanageChild ((Widget) m_mainWidget);
     XtUnrealizeWidget ((Widget) m_mainWidget);
     XtUnmanageChild ((Widget) m_mainWidget);
     XtUnrealizeWidget ((Widget) m_mainWidget);
-    
+
     int i;
     for (i = 0; i < GetMenuCount(); i++)
     {
         wxMenu *menu = GetMenu(i);
         menu->DestroyMenu(TRUE);
     int i;
     for (i = 0; i < GetMenuCount(); i++)
     {
         wxMenu *menu = GetMenu(i);
         menu->DestroyMenu(TRUE);
-        
+
     }
     XtDestroyWidget((Widget) m_mainWidget);
     m_mainWidget = (WXWidget) 0;
     }
     XtDestroyWidget((Widget) m_mainWidget);
     m_mainWidget = (WXWidget) 0;
-    
+
     SetMenuBarFrame((wxFrame*) NULL);
     SetMenuBarFrame((wxFrame*) NULL);
-    
+
     return TRUE;
 }
 
     return TRUE;
 }
 
@@ -900,7 +898,7 @@ int PostDeletionOfMenu( XtPointer* clientData )
 {
     XtRemoveWorkProc(WorkProcMenuId);
     wxMenu *menu = (wxMenu *)clientData;
 {
     XtRemoveWorkProc(WorkProcMenuId);
     wxMenu *menu = (wxMenu *)clientData;
-    
+
     if (menu->GetMainWidget()) {
         if (menu->GetParent())
         {
     if (menu->GetMainWidget()) {
         if (menu->GetParent())
         {
@@ -914,20 +912,20 @@ int PostDeletionOfMenu( XtPointer* clientData )
     return TRUE;
 }
 
     return TRUE;
 }
 
-void 
+void
 wxMenuPopdownCallback(Widget w, XtPointer clientData,
                       XtPointer ptr)
 {
     wxMenu *menu = (wxMenu *)clientData;
 wxMenuPopdownCallback(Widget w, XtPointer clientData,
                       XtPointer ptr)
 {
     wxMenu *menu = (wxMenu *)clientData;
-    
+
     // Added by JOREL Jean-Charles <jjorel@silr.ireste.fr>
     /* Since Callbacks of MenuItems are not yet processed, we put a
     * background job which will be done when system will be idle.
     * What awful hack!! :(
     */
     // Added by JOREL Jean-Charles <jjorel@silr.ireste.fr>
     /* Since Callbacks of MenuItems are not yet processed, we put a
     * background job which will be done when system will be idle.
     * What awful hack!! :(
     */
-    
-    WorkProcMenuId = XtAppAddWorkProc( 
-        (XtAppContext) wxTheApp->GetAppContext(), 
+
+    WorkProcMenuId = XtAppAddWorkProc(
+        (XtAppContext) wxTheApp->GetAppContext(),
         (XtWorkProc) PostDeletionOfMenu,
         (XtPointer) menu );
     // Apparently not found in Motif headers
         (XtWorkProc) PostDeletionOfMenu,
         (XtPointer) menu );
     // Apparently not found in Motif headers
@@ -947,12 +945,12 @@ WXWidget wxMenu::CreateMenu (wxMenuBar * menuBar, WXWidget parent, wxMenu * topM
     Arg args[5];
     XtSetArg (args[0], XmNnumColumns, m_numColumns);
     XtSetArg (args[1], XmNpacking, XmPACK_COLUMN);
     Arg args[5];
     XtSetArg (args[0], XmNnumColumns, m_numColumns);
     XtSetArg (args[1], XmNpacking, XmPACK_COLUMN);
-    
+
     if (!pullDown)
     {
         menu = XmCreatePopupMenu ((Widget) parent, "popup", args, 2);
         XtAddCallback(menu,
     if (!pullDown)
     {
         menu = XmCreatePopupMenu ((Widget) parent, "popup", args, 2);
         XtAddCallback(menu,
-            XmNunmapCallback, 
+            XmNunmapCallback,
             (XtCallbackProc)wxMenuPopdownCallback,
             (XtPointer)this);
     }
             (XtCallbackProc)wxMenuPopdownCallback,
             (XtPointer)this);
     }
@@ -960,9 +958,9 @@ WXWidget wxMenu::CreateMenu (wxMenuBar * menuBar, WXWidget parent, wxMenu * topM
     {
         char mnem = wxFindMnemonic (title);
         wxStripMenuCodes ((char*) (const char*) title, wxBuffer);
     {
         char mnem = wxFindMnemonic (title);
         wxStripMenuCodes ((char*) (const char*) title, wxBuffer);
-        
+
         menu = XmCreatePulldownMenu ((Widget) parent, "pulldown", args, 2);
         menu = XmCreatePulldownMenu ((Widget) parent, "pulldown", args, 2);
-        
+
         XmString label_str = XmStringCreateSimple (wxBuffer);
         buttonWidget = XtVaCreateManagedWidget (wxBuffer,
 #if wxUSE_GADGETS
         XmString label_str = XmStringCreateSimple (wxBuffer);
         buttonWidget = XtVaCreateManagedWidget (wxBuffer,
 #if wxUSE_GADGETS
@@ -973,44 +971,44 @@ WXWidget wxMenu::CreateMenu (wxMenuBar * menuBar, WXWidget parent, wxMenu * topM
             XmNlabelString, label_str,
             XmNsubMenuId, menu,
             NULL);
             XmNlabelString, label_str,
             XmNsubMenuId, menu,
             NULL);
-        
+
         if (mnem != 0)
             XtVaSetValues (buttonWidget, XmNmnemonic, mnem, NULL);
         if (mnem != 0)
             XtVaSetValues (buttonWidget, XmNmnemonic, mnem, NULL);
-        
+
         XmStringFree (label_str);
     }
         XmStringFree (label_str);
     }
-    
+
     m_menuWidget = (WXWidget) menu;
     m_menuWidget = (WXWidget) menu;
-    
+
     m_menuBar = menuBar;
     m_topLevelMenu = topMenu;
     m_menuBar = menuBar;
     m_topLevelMenu = topMenu;
-    
+
     for (wxNode * node = m_menuItems.First (); node; node = node->Next ())
     {
         wxMenuItem *item = (wxMenuItem *) node->Data ();
         item->CreateItem (menu, menuBar, topMenu);
     }
     for (wxNode * node = m_menuItems.First (); node; node = node->Next ())
     {
         wxMenuItem *item = (wxMenuItem *) node->Data ();
         item->CreateItem (menu, menuBar, topMenu);
     }
-    
+
     SetBackgroundColour(m_backgroundColour);
     SetForegroundColour(m_foregroundColour);
     SetFont(m_font);
     SetBackgroundColour(m_backgroundColour);
     SetForegroundColour(m_foregroundColour);
     SetFont(m_font);
-    
+
     return buttonWidget;
 }
 
 // Destroys the Motif implementation of the menu,
 // but maintains the wxWindows data structures so we can
     return buttonWidget;
 }
 
 // Destroys the Motif implementation of the menu,
 // but maintains the wxWindows data structures so we can
-// do a CreateMenu again. 
+// do a CreateMenu again.
 void wxMenu::DestroyMenu (bool full)
 {
     for (wxNode * node = m_menuItems.First (); node; node = node->Next ())
     {
         wxMenuItem *item = (wxMenuItem *) node->Data ();
         item->SetMenuBar((wxMenuBar*) NULL);
 void wxMenu::DestroyMenu (bool full)
 {
     for (wxNode * node = m_menuItems.First (); node; node = node->Next ())
     {
         wxMenuItem *item = (wxMenuItem *) node->Data ();
         item->SetMenuBar((wxMenuBar*) NULL);
-        
+
         item->DestroyItem(full);
         item->DestroyItem(full);
-    }                          // for()
-    
+    }// for()
+
     if (m_buttonWidget)
     {
         if (full)
     if (m_buttonWidget)
     {
         if (full)
@@ -1035,7 +1033,7 @@ WXWidget wxMenu::FindMenuItem (int id, wxMenuItem ** it) const
             *it = (wxMenuItem*) NULL;
         return m_buttonWidget;
     }
             *it = (wxMenuItem*) NULL;
         return m_buttonWidget;
     }
-    
+
     for (wxNode * node = m_menuItems.First (); node; node = node->Next ())
     {
         wxMenuItem *item = (wxMenuItem *) node->Data ();
     for (wxNode * node = m_menuItems.First (); node; node = node->Next ())
     {
         wxMenuItem *item = (wxMenuItem *) node->Data ();
@@ -1045,7 +1043,7 @@ WXWidget wxMenu::FindMenuItem (int id, wxMenuItem ** it) const
                 *it = item;
             return item->GetButtonWidget();
         }
                 *it = item;
             return item->GetButtonWidget();
         }
-        
+
         if (item->GetSubMenu())
         {
             WXWidget w = item->GetSubMenu()->FindMenuItem (id, it);
         if (item->GetSubMenu())
         {
             WXWidget w = item->GetSubMenu()->FindMenuItem (id, it);
@@ -1054,8 +1052,8 @@ WXWidget wxMenu::FindMenuItem (int id, wxMenuItem ** it) const
                 return w;
             }
         }
                 return w;
             }
         }
-    }                          // for()
-    
+    }// for()
+
     if (it)
         *it = (wxMenuItem*) NULL;
     return (WXWidget) NULL;
     if (it)
         *it = (wxMenuItem*) NULL;
     return (WXWidget) NULL;
@@ -1068,7 +1066,7 @@ void wxMenu::SetBackgroundColour(const wxColour& col)
         wxDoChangeBackgroundColour(m_menuWidget, (wxColour&) col);
     if (m_buttonWidget)
         wxDoChangeBackgroundColour(m_buttonWidget, (wxColour&) col, TRUE);
         wxDoChangeBackgroundColour(m_menuWidget, (wxColour&) col);
     if (m_buttonWidget)
         wxDoChangeBackgroundColour(m_buttonWidget, (wxColour&) col, TRUE);
-    
+
     wxNode* node = m_menuItems.First();
     while (node)
     {
     wxNode* node = m_menuItems.First();
     while (node)
     {
@@ -1091,7 +1089,7 @@ void wxMenu::SetForegroundColour(const wxColour& col)
         wxDoChangeForegroundColour(m_menuWidget, (wxColour&) col);
     if (m_buttonWidget)
         wxDoChangeForegroundColour(m_buttonWidget, (wxColour&) col);
         wxDoChangeForegroundColour(m_menuWidget, (wxColour&) col);
     if (m_buttonWidget)
         wxDoChangeForegroundColour(m_buttonWidget, (wxColour&) col);
-    
+
     wxNode* node = m_menuItems.First();
     while (node)
     {
     wxNode* node = m_menuItems.First();
     while (node)
     {
@@ -1110,12 +1108,12 @@ void wxMenu::SetForegroundColour(const wxColour& col)
 void wxMenu::ChangeFont(bool keepOriginalSize)
 {
     // lesstif 0.87 hangs when setting XmNfontList
 void wxMenu::ChangeFont(bool keepOriginalSize)
 {
     // lesstif 0.87 hangs when setting XmNfontList
-#ifndef LESSTIF_VERSION        
+#ifndef LESSTIF_VERSION
     if (!m_font.Ok() || !m_menuWidget)
         return;
     if (!m_font.Ok() || !m_menuWidget)
         return;
-    
+
     XmFontList fontList = (XmFontList) m_font.GetFontList(1.0, XtDisplay((Widget) m_menuWidget));
     XmFontList fontList = (XmFontList) m_font.GetFontList(1.0, XtDisplay((Widget) m_menuWidget));
-    
+
     XtVaSetValues ((Widget) m_menuWidget,
         XmNfontList, fontList,
         NULL);
     XtVaSetValues ((Widget) m_menuWidget,
         XmNfontList, fontList,
         NULL);
@@ -1150,7 +1148,7 @@ void wxMenu::SetFont(const wxFont& font)
 
 void wxMenuBar::SetBackgroundColour(const wxColour& col)
 {
 
 void wxMenuBar::SetBackgroundColour(const wxColour& col)
 {
-    
+
     m_backgroundColour = col;
     if (m_mainWidget)
         wxDoChangeBackgroundColour(m_mainWidget, (wxColour&) col);
     m_backgroundColour = col;
     if (m_mainWidget)
         wxDoChangeBackgroundColour(m_mainWidget, (wxColour&) col);
@@ -1164,7 +1162,7 @@ void wxMenuBar::SetForegroundColour(const wxColour& col)
     m_foregroundColour = col;
     if (m_mainWidget)
         wxDoChangeForegroundColour(m_mainWidget, (wxColour&) col);
     m_foregroundColour = col;
     if (m_mainWidget)
         wxDoChangeForegroundColour(m_mainWidget, (wxColour&) col);
-    
+
     int i;
     for (i = 0; i < m_menuCount; i++)
         m_menus[i]->SetForegroundColour((wxColour&) col);
     int i;
     for (i = 0; i < m_menuCount; i++)
         m_menus[i]->SetForegroundColour((wxColour&) col);
@@ -1179,7 +1177,7 @@ void wxMenuBar::SetFont(const wxFont& font)
 {
     m_font = font;
     ChangeFont();
 {
     m_font = font;
     ChangeFont();
-    
+
     int i;
     for (i = 0; i < m_menuCount; i++)
         m_menus[i]->SetFont(font);
     int i;
     for (i = 0; i < m_menuCount; i++)
         m_menus[i]->SetFont(font);
index 450c691097237a11ce36ee74c61a7720b624587f..3e365621a1c2eafa8f06d68f5e33641a8d4fea76 100644 (file)
@@ -6,7 +6,7 @@
 // Created:     17/09/98
 // RCS-ID:      $Id$
 // Copyright:   (c) Julian Smart
 // Created:     17/09/98
 // RCS-ID:      $Id$
 // Copyright:   (c) Julian Smart
-// Licence:    wxWindows licence
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 /*
 /////////////////////////////////////////////////////////////////////////////
 
 /*
@@ -17,7 +17,7 @@
  * in Create().  The cells are freed on the next call to Create()
  * or when the destructor is called.
  */
  * in Create().  The cells are freed on the next call to Create()
  * or when the destructor is called.
  */
+
 /* Wolfram Gloger <u7y22ab@sunmail.lrz-muenchen.de>
 I have implemented basic colormap support for the X11 versions of
 wxWindows, notably wxPalette::Create().  The way I did it is to
 /* Wolfram Gloger <u7y22ab@sunmail.lrz-muenchen.de>
 I have implemented basic colormap support for the X11 versions of
 wxWindows, notably wxPalette::Create().  The way I did it is to
@@ -71,11 +71,10 @@ wxPaletteRefData::wxPaletteRefData()
 
 wxPaletteRefData::~wxPaletteRefData()
 {
 
 wxPaletteRefData::~wxPaletteRefData()
 {
-    XColor xcol;
     Display *display = (Display*) NULL;
     Display *display = (Display*) NULL;
-    
+
     wxNode *node, *next;
     wxNode *node, *next;
-    
+
     for (node = m_palettes.First(); node; node = next) {
         wxXPalette *c = (wxXPalette *)node->Data();
         unsigned long *pix_array = c->m_pix_array;
     for (node = m_palettes.First(); node; node = next) {
         wxXPalette *c = (wxXPalette *)node->Data();
         unsigned long *pix_array = c->m_pix_array;
@@ -83,7 +82,7 @@ wxPaletteRefData::~wxPaletteRefData()
         bool destroyable = c->m_destroyable;
         int pix_array_n = c->m_pix_array_n;
         display = (Display*) c->m_display;
         bool destroyable = c->m_destroyable;
         int pix_array_n = c->m_pix_array_n;
         display = (Display*) c->m_display;
-        
+
         if (pix_array_n > 0)
         {
             //      XFreeColors(display, cmap, pix_array, pix_array_n, 0);
         if (pix_array_n > 0)
         {
             //      XFreeColors(display, cmap, pix_array, pix_array_n, 0);
@@ -96,10 +95,10 @@ wxPaletteRefData::~wxPaletteRefData()
             }
             delete [] pix_array;
         }
             }
             delete [] pix_array;
         }
-        
+
         if (destroyable)
             XFreeColormap(display, cmap);
         if (destroyable)
             XFreeColormap(display, cmap);
-        
+
         next = node->Next();
         m_palettes.DeleteNode(node);
         delete c;
         next = node->Next();
         m_palettes.DeleteNode(node);
         delete c;
@@ -122,26 +121,26 @@ wxPalette::~wxPalette()
 bool wxPalette::Create(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue)
 {
     UnRef();
 bool wxPalette::Create(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue)
 {
     UnRef();
-    
+
     if (!n) {
         return FALSE;
     }
     if (!n) {
         return FALSE;
     }
-    
+
     m_refData = new wxPaletteRefData;
     m_refData = new wxPaletteRefData;
-    
+
     XColor xcol;
     Display* display = (Display*) wxGetDisplay();
     XColor xcol;
     Display* display = (Display*) wxGetDisplay();
-    
+
     unsigned long *pix_array;
     Colormap cmap;
     int pix_array_n;
     unsigned long *pix_array;
     Colormap cmap;
     int pix_array_n;
-    
+
     cmap = (Colormap) wxTheApp->GetMainColormap(display);
     cmap = (Colormap) wxTheApp->GetMainColormap(display);
-    
+
     pix_array = new unsigned long[n];
     if (!pix_array)
         return FALSE;
     pix_array = new unsigned long[n];
     if (!pix_array)
         return FALSE;
-    
+
     pix_array_n = n;
     xcol.flags = DoRed | DoGreen | DoBlue;
     for(int i = 0; i < n; i++) {
     pix_array_n = n;
     xcol.flags = DoRed | DoGreen | DoBlue;
     for(int i = 0; i < n; i++) {
@@ -150,16 +149,16 @@ bool wxPalette::Create(int n, const unsigned char *red, const unsigned char *gre
         xcol.blue = (unsigned short)blue[i] << 8;
         pix_array[i] = (XAllocColor(display, cmap, &xcol) == 0) ? 0 : xcol.pixel;
     }
         xcol.blue = (unsigned short)blue[i] << 8;
         pix_array[i] = (XAllocColor(display, cmap, &xcol) == 0) ? 0 : xcol.pixel;
     }
-    
+
     wxXPalette *c = new wxXPalette;
     wxXPalette *c = new wxXPalette;
-    
+
     c->m_pix_array_n = pix_array_n;
     c->m_pix_array = pix_array;
     c->m_cmap = (WXColormap) cmap;
     c->m_display = (WXDisplay*) display;
     c->m_destroyable = FALSE;
     M_PALETTEDATA->m_palettes.Append(c);
     c->m_pix_array_n = pix_array_n;
     c->m_pix_array = pix_array;
     c->m_cmap = (WXColormap) cmap;
     c->m_display = (WXDisplay*) display;
     c->m_destroyable = FALSE;
     M_PALETTEDATA->m_palettes.Append(c);
-    
+
     return TRUE;
 }
 
     return TRUE;
 }
 
@@ -167,7 +166,7 @@ int wxPalette::GetPixel(const unsigned char red, const unsigned char green, cons
 {
     if ( !m_refData )
         return FALSE;
 {
     if ( !m_refData )
         return FALSE;
-    
+
     // TODO
     return FALSE;
 }
     // TODO
     return FALSE;
 }
@@ -176,10 +175,10 @@ bool wxPalette::GetRGB(int index, unsigned char *red, unsigned char *green, unsi
 {
     if ( !m_refData )
         return FALSE;
 {
     if ( !m_refData )
         return FALSE;
-    
+
     if (index < 0 || index > 255)
         return FALSE;
     if (index < 0 || index > 255)
         return FALSE;
-    
+
     // TODO
     return FALSE;
 }
     // TODO
     return FALSE;
 }
@@ -188,7 +187,7 @@ WXColormap wxPalette::GetXColormap(WXDisplay* display) const
 {
     if (!M_PALETTEDATA || (M_PALETTEDATA->m_palettes.Number() == 0))
         return wxTheApp->GetMainColormap(display);
 {
     if (!M_PALETTEDATA || (M_PALETTEDATA->m_palettes.Number() == 0))
         return wxTheApp->GetMainColormap(display);
-    
+
     wxNode* node = M_PALETTEDATA->m_palettes.First();
     if (!display && node)
     {
     wxNode* node = M_PALETTEDATA->m_palettes.First();
     if (!display && node)
     {
@@ -200,22 +199,22 @@ WXColormap wxPalette::GetXColormap(WXDisplay* display) const
         wxXPalette* p = (wxXPalette*) node->Data();
         if (p->m_display == display)
             return p->m_cmap;
         wxXPalette* p = (wxXPalette*) node->Data();
         if (p->m_display == display)
             return p->m_cmap;
-        
+
         node = node->Next();
     }
         node = node->Next();
     }
-    
+
     /* Make a new one: */
     wxXPalette *c = new wxXPalette;
     wxXPalette *first = (wxXPalette *)M_PALETTEDATA->m_palettes.First()->Data();
     XColor xcol;
     int pix_array_n = first->m_pix_array_n;
     /* Make a new one: */
     wxXPalette *c = new wxXPalette;
     wxXPalette *first = (wxXPalette *)M_PALETTEDATA->m_palettes.First()->Data();
     XColor xcol;
     int pix_array_n = first->m_pix_array_n;
-    
+
     c->m_pix_array_n = pix_array_n;
     c->m_pix_array = new unsigned long[pix_array_n];
     c->m_display = display;
     c->m_cmap = wxTheApp->GetMainColormap(display);
     c->m_destroyable = FALSE;
     c->m_pix_array_n = pix_array_n;
     c->m_pix_array = new unsigned long[pix_array_n];
     c->m_display = display;
     c->m_cmap = wxTheApp->GetMainColormap(display);
     c->m_destroyable = FALSE;
-    
+
     xcol.flags = DoRed | DoGreen | DoBlue;
     int i;
     for (i = 0; i < pix_array_n; i++)
     xcol.flags = DoRed | DoGreen | DoBlue;
     int i;
     for (i = 0; i < pix_array_n; i++)
@@ -225,11 +224,11 @@ WXColormap wxPalette::GetXColormap(WXDisplay* display) const
         c->m_pix_array[i] =
             (XAllocColor((Display*) display, (Colormap) c->m_cmap, &xcol) == 0) ? 0 : xcol.pixel;
     }
         c->m_pix_array[i] =
             (XAllocColor((Display*) display, (Colormap) c->m_cmap, &xcol) == 0) ? 0 : xcol.pixel;
     }
-    
+
     //    wxPalette* nonConstThis = (wxPalette*) this;
     //    wxPalette* nonConstThis = (wxPalette*) this;
-    
+
     M_PALETTEDATA->m_palettes.Append(c);
     M_PALETTEDATA->m_palettes.Append(c);
-    
+
     return c->m_cmap;
 }
 
     return c->m_cmap;
 }
 
@@ -247,7 +246,7 @@ bool wxPalette::TransferBitmap(void *data, int depth, int size)
                     *uptr = (unsigned char)pix_array[*uptr];
                 uptr++;
             }
                     *uptr = (unsigned char)pix_array[*uptr];
                 uptr++;
             }
-            
+
             return TRUE;
         }
     default:
             return TRUE;
         }
     default:
@@ -315,7 +314,7 @@ unsigned long *wxPalette::GetXPixArray(WXDisplay *display, int *n)
     if (!M_PALETTEDATA)
         return (unsigned long*) 0;
     wxNode *node;
     if (!M_PALETTEDATA)
         return (unsigned long*) 0;
     wxNode *node;
-    
+
     for (node = M_PALETTEDATA->m_palettes.First(); node; node = node->Next())
     {
         wxXPalette *c = (wxXPalette *)node->Data();
     for (node = M_PALETTEDATA->m_palettes.First(); node; node = node->Next())
     {
         wxXPalette *c = (wxXPalette *)node->Data();
@@ -326,7 +325,7 @@ unsigned long *wxPalette::GetXPixArray(WXDisplay *display, int *n)
             return c->m_pix_array;
         }
     }
             return c->m_pix_array;
         }
     }
-    
+
     /* Not found; call GetXColormap, which will create it, then this again */
     if (GetXColormap(display))
         return GetXPixArray(display, n);
     /* Not found; call GetXColormap, which will create it, then this again */
     if (GetXColormap(display))
         return GetXPixArray(display, n);
@@ -337,17 +336,17 @@ unsigned long *wxPalette::GetXPixArray(WXDisplay *display, int *n)
 void wxPalette::PutXColormap(WXDisplay* display, WXColormap cm, bool dp)
 {
     UnRef();
 void wxPalette::PutXColormap(WXDisplay* display, WXColormap cm, bool dp)
 {
     UnRef();
-    
+
     m_refData = new wxPaletteRefData;
     m_refData = new wxPaletteRefData;
-    
+
     wxXPalette *c = new wxXPalette;
     wxXPalette *c = new wxXPalette;
-    
+
     c->m_pix_array_n = 0;
     c->m_pix_array = (unsigned long*) NULL;
     c->m_display = display;
     c->m_cmap = cm;
     c->m_destroyable = dp;
     c->m_pix_array_n = 0;
     c->m_pix_array = (unsigned long*) NULL;
     c->m_display = display;
     c->m_cmap = cm;
     c->m_destroyable = dp;
-    
+
     M_PALETTEDATA->m_palettes.Append(c);
 }
 
     M_PALETTEDATA->m_palettes.Append(c);
 }
 
index 2ab14b3f8ab18438983cb80867e54d2299801423..51bcf4efb44b2f903dc536224a65015ea445d373 100644 (file)
@@ -6,7 +6,7 @@
 // Created:     04/01/98
 // RCS-ID:      $Id$
 // Copyright:   (c) Julian Smart
 // Created:     04/01/98
 // RCS-ID:      $Id$
 // Copyright:   (c) Julian Smart
-// Licence:    wxWindows licence
+// Licence:           wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 #ifdef __GNUG__
 /////////////////////////////////////////////////////////////////////////////
 
 #ifdef __GNUG__
@@ -36,7 +36,7 @@ END_EVENT_TABLE()
 #endif
 
 static void wxToolButtonCallback (Widget w, XtPointer clientData,
 #endif
 
 static void wxToolButtonCallback (Widget w, XtPointer clientData,
-                   XtPointer ptr);
+                    XtPointer ptr);
 static void wxToolButtonPopupCallback (Widget w, XtPointer client_data,
                      XEvent *event, Boolean *continue_to_dispatch);
 
 static void wxToolButtonPopupCallback (Widget w, XtPointer client_data,
                      XEvent *event, Boolean *continue_to_dispatch);
 
@@ -71,7 +71,7 @@ bool wxToolBar::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, cons
 {
     m_maxWidth = -1;
     m_maxHeight = -1;
 {
     m_maxWidth = -1;
     m_maxHeight = -1;
-  
+
     m_defaultWidth = 24;
     m_defaultHeight = 22;
     SetName(name);
     m_defaultWidth = 24;
     m_defaultHeight = 22;
     SetName(name);
@@ -113,7 +113,7 @@ bool wxToolBar::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, cons
     AttachWidget (parent, m_mainWidget, (WXWidget) NULL, pos.x, pos.y, size.x, size.y);
 
     ChangeBackgroundColour();
     AttachWidget (parent, m_mainWidget, (WXWidget) NULL, pos.x, pos.y, size.x, size.y);
 
     ChangeBackgroundColour();
-  
+
     return TRUE;
 }
 
     return TRUE;
 }
 
@@ -158,15 +158,15 @@ bool wxToolBar::CreateTools()
 
             if (tool->m_isToggle)
             {
 
             if (tool->m_isToggle)
             {
-                button = XtVaCreateWidget("toggleButton", 
+                button = XtVaCreateWidget("toggleButton",
                    xmToggleButtonWidgetClass, (Widget) m_mainWidget,
                    XmNx, currentX, XmNy, currentY,
                    xmToggleButtonWidgetClass, (Widget) m_mainWidget,
                    XmNx, currentX, XmNy, currentY,
-                                                //                   XmNpushButtonEnabled, True,
+                                                 //                   XmNpushButtonEnabled, True,
                    XmNmultiClick, XmMULTICLICK_KEEP,
                    XmNlabelType, XmPIXMAP,
                    NULL);
                 XtAddCallback ((Widget) button, XmNvalueChangedCallback, (XtCallbackProc) wxToolButtonCallback,
                    XmNmultiClick, XmMULTICLICK_KEEP,
                    XmNlabelType, XmPIXMAP,
                    NULL);
                 XtAddCallback ((Widget) button, XmNvalueChangedCallback, (XtCallbackProc) wxToolButtonCallback,
-                (XtPointer) this);
+                 (XtPointer) this);
 
                 XtVaSetValues ((Widget) button,
                       XmNselectColor, m_backgroundColour.AllocColour(XtDisplay((Widget) button)),
 
                 XtVaSetValues ((Widget) button,
                       XmNselectColor, m_backgroundColour.AllocColour(XtDisplay((Widget) button)),
@@ -174,7 +174,7 @@ bool wxToolBar::CreateTools()
             }
             else
             {
             }
             else
             {
-                button = XtVaCreateWidget("button", 
+                button = XtVaCreateWidget("button",
                    xmPushButtonWidgetClass, (Widget) m_mainWidget,
                    XmNx, currentX, XmNy, currentY,
                    XmNpushButtonEnabled, True,
                    xmPushButtonWidgetClass, (Widget) m_mainWidget,
                    XmNx, currentX, XmNy, currentY,
                    XmNpushButtonEnabled, True,
@@ -198,12 +198,12 @@ bool wxToolBar::CreateTools()
             {
                 int backgroundPixel;
                 XtVaGetValues(button, XmNbackground, &backgroundPixel,
             {
                 int backgroundPixel;
                 XtVaGetValues(button, XmNbackground, &backgroundPixel,
-                             NULL);
+                              NULL);
 
 
                 wxColour col;
                 col.SetPixel(backgroundPixel);
 
 
                 wxColour col;
                 col.SetPixel(backgroundPixel);
-                
+
                 wxBitmap newBitmap = wxCreateMaskedBitmap(tool->m_bitmap1, col);
 
                 tool->m_bitmap1 = newBitmap;
                 wxBitmap newBitmap = wxCreateMaskedBitmap(tool->m_bitmap1, col);
 
                 tool->m_bitmap1 = newBitmap;
@@ -214,10 +214,10 @@ bool wxToolBar::CreateTools()
             int backgroundPixel;
             if (tool->m_isToggle)
                 XtVaGetValues(button, XmNselectColor, &backgroundPixel,
             int backgroundPixel;
             if (tool->m_isToggle)
                 XtVaGetValues(button, XmNselectColor, &backgroundPixel,
-                     NULL);
+                      NULL);
             else
                 XtVaGetValues(button, XmNarmColor, &backgroundPixel,
             else
                 XtVaGetValues(button, XmNarmColor, &backgroundPixel,
-                     NULL);
+                      NULL);
 
             wxColour col;
             col.SetPixel(backgroundPixel);
 
             wxColour col;
             col.SetPixel(backgroundPixel);
@@ -235,7 +235,7 @@ bool wxToolBar::CreateTools()
                 {
                     wxBitmap newBitmap = wxCreateMaskedBitmap(originalBitmap, col);
                     tool->m_bitmap2 = newBitmap;
                 {
                     wxBitmap newBitmap = wxCreateMaskedBitmap(originalBitmap, col);
                     tool->m_bitmap2 = newBitmap;
-               }
+                }
                 else
                     tool->m_bitmap2 = tool->m_bitmap1;
             }
                 else
                     tool->m_bitmap2 = tool->m_bitmap1;
             }
@@ -264,11 +264,11 @@ bool wxToolBar::CreateTools()
                 }
                 XtVaSetValues (button,
                     XmNindicatorOn, False,
                 }
                 XtVaSetValues (button,
                     XmNindicatorOn, False,
-                   XmNshadowThickness, 2,
-                              //                   XmNborderWidth, 0,
-                              //                   XmNspacing, 0,
-                   XmNmarginWidth, 0,
-                   XmNmarginHeight, 0,
+                    XmNshadowThickness, 2,
+                               //                    XmNborderWidth, 0,
+                               //                    XmNspacing, 0,
+                    XmNmarginWidth, 0,
+                    XmNmarginHeight, 0,
                     XmNfillOnSelect, True,
                     XmNlabelPixmap, pixmap,
                     XmNselectPixmap, pixmap2,
                     XmNfillOnSelect, True,
                     XmNlabelPixmap, pixmap,
                     XmNselectPixmap, pixmap2,
@@ -303,11 +303,11 @@ bool wxToolBar::CreateTools()
 
             Dimension width, height;
             XtVaGetValues(button, XmNwidth, & width, XmNheight, & height,
 
             Dimension width, height;
             XtVaGetValues(button, XmNwidth, & width, XmNheight, & height,
-                             NULL);
+                              NULL);
             currentX += width + marginX;
             buttonHeight = wxMax(buttonHeight, height);
 
             currentX += width + marginX;
             buttonHeight = wxMax(buttonHeight, height);
 
-            XtAddEventHandler (button, EnterWindowMask | LeaveWindowMask, 
+            XtAddEventHandler (button, EnterWindowMask | LeaveWindowMask,
                        False, wxToolButtonPopupCallback, (XtPointer) this);
             m_widgets.Append(tool->m_index, (wxObject*) button);
 
                        False, wxToolButtonPopupCallback, (XtPointer) this);
             m_widgets.Append(tool->m_index, (wxObject*) button);
 
@@ -471,7 +471,7 @@ WXWidget wxToolBar::GetMainWidget() const
 
 
 void wxToolButtonCallback (Widget w, XtPointer clientData,
 
 
 void wxToolButtonCallback (Widget w, XtPointer clientData,
-                   XtPointer ptr)
+                    XtPointer ptr)
 {
     wxToolBar *toolBar = (wxToolBar *) clientData;
     int index = toolBar->FindIndexForWidget((WXWidget) w);
 {
     wxToolBar *toolBar = (wxToolBar *) clientData;
     int index = toolBar->FindIndexForWidget((WXWidget) w);
@@ -505,7 +505,6 @@ static void wxToolButtonPopupCallback (Widget w, XtPointer client_data,
         wxNode *node = toolBar->GetTools().Find((long)index);
         if (!node)
             return;
         wxNode *node = toolBar->GetTools().Find((long)index);
         if (!node)
             return;
-        wxToolBarTool *tool = (wxToolBarTool *)node->Data();
         wxString str(toolBar->GetToolShortHelp(index));
         if (str.IsNull() || str == "")
             return;
         wxString str(toolBar->GetToolShortHelp(index));
         if (str.IsNull() || str == "")
             return;
@@ -513,8 +512,8 @@ static void wxToolButtonPopupCallback (Widget w, XtPointer client_data,
         if (!wxTheToolBarTimer)
           wxTheToolBarTimer = new wxToolBarTimer;
 
         if (!wxTheToolBarTimer)
           wxTheToolBarTimer = new wxToolBarTimer;
 
-       wxToolBarTimer::buttonWidget = w;
-       wxToolBarTimer::helpString = str;
+        wxToolBarTimer::buttonWidget = w;
+        wxToolBarTimer::helpString = str;
 
 
     /************************************************************/
 
 
     /************************************************************/
@@ -526,7 +525,7 @@ static void wxToolButtonPopupCallback (Widget w, XtPointer client_data,
         {
             XtDestroyWidget (wxToolBarTimer::help_popup);
             XtPopdown (wxToolBarTimer::help_popup);
         {
             XtDestroyWidget (wxToolBarTimer::help_popup);
             XtPopdown (wxToolBarTimer::help_popup);
-       }
+        }
         wxToolBarTimer::help_popup = (Widget) 0;
 
         // One shot
         wxToolBarTimer::help_popup = (Widget) 0;
 
         // One shot
@@ -544,7 +543,7 @@ static void wxToolButtonPopupCallback (Widget w, XtPointer client_data,
         {
             XtDestroyWidget (wxToolBarTimer::help_popup);
             XtPopdown (wxToolBarTimer::help_popup);
         {
             XtDestroyWidget (wxToolBarTimer::help_popup);
             XtPopdown (wxToolBarTimer::help_popup);
-       }
+        }
         wxToolBarTimer::help_popup = (Widget) 0;
     }
     }
         wxToolBarTimer::help_popup = (Widget) 0;
     }
     }
@@ -557,16 +556,16 @@ void wxToolBarTimer::Notify()
         /************************************************************/
         /* Create shell without window decorations                  */
         /************************************************************/
         /************************************************************/
         /* Create shell without window decorations                  */
         /************************************************************/
-        help_popup = XtVaCreatePopupShell ("shell", 
-                                           overrideShellWidgetClass, (Widget) wxTheApp->GetTopLevelWidget(), 
+        help_popup = XtVaCreatePopupShell ("shell",
+                                           overrideShellWidgetClass, (Widget) wxTheApp->GetTopLevelWidget(),
                                            NULL);
 
         /************************************************************/
         /* Get absolute position on display of toolbar button       */
         /************************************************************/
         XtTranslateCoords (buttonWidget,
                                            NULL);
 
         /************************************************************/
         /* Get absolute position on display of toolbar button       */
         /************************************************************/
         XtTranslateCoords (buttonWidget,
-                           (Position) 0, 
-                           (Position) 0, 
+                           (Position) 0,
+                           (Position) 0,
                            &x, &y);
 
         // Move the tooltip more or less above the button
                            &x, &y);
 
         // Move the tooltip more or less above the button
@@ -577,24 +576,24 @@ void wxToolBarTimer::Notify()
         /************************************************************/
         /* Set the position of the help popup                       */
         /************************************************************/
         /************************************************************/
         /* Set the position of the help popup                       */
         /************************************************************/
-        XtVaSetValues (help_popup, 
-                       XmNx, (Position) x, 
-                       XmNy, (Position) y, 
+        XtVaSetValues (help_popup,
+                       XmNx, (Position) x,
+                       XmNy, (Position) y,
                        NULL);
                        NULL);
-        
+
         /************************************************************/
         /* Create help label                                        */
         /************************************************************/
         XmString text = XmStringCreateSimple ((char*) (const char*) helpString);
         /************************************************************/
         /* Create help label                                        */
         /************************************************************/
         XmString text = XmStringCreateSimple ((char*) (const char*) helpString);
-        XtVaCreateManagedWidget ("help_label", 
-                                 xmLabelWidgetClass, help_popup, 
+        XtVaCreateManagedWidget ("help_label",
+                                 xmLabelWidgetClass, help_popup,
                                  XmNlabelString, text,
                                  XmNlabelString, text,
-                                 XtVaTypedArg, 
-                                 XmNforeground, XtRString, "black", 
-                                                strlen("black")+1,      
-                                 XtVaTypedArg, 
-                                 XmNbackground, XtRString, "LightGoldenrod", 
-                                                strlen("LightGoldenrod")+1, 
+                                 XtVaTypedArg,
+                                 XmNforeground, XtRString, "black",
+                                                strlen("black")+1,
+                                 XtVaTypedArg,
+                                 XmNbackground, XtRString, "LightGoldenrod",
+                                                strlen("LightGoldenrod")+1,
                                  NULL);
         XmStringFree (text);
 
                                  NULL);
         XmStringFree (text);
 
index 65d6c32becad7c80410e643bd4a7c30697efdcad..41679869ccc21b60dc255280af6fc568ca780a63 100644 (file)
@@ -75,7 +75,7 @@ void wxFlushEvents()
     Display *display = (Display*) wxGetDisplay();
 
     XSync (display, FALSE);
     Display *display = (Display*) wxGetDisplay();
 
     XSync (display, FALSE);
-    XEvent event;
+
     // XtAppPending returns availability of events AND timers/inputs, which
     // are processed via callbacks, so XtAppNextEvent will not return if
     // there are no events. So added '& XtIMXEvent' - Sergey.
     // XtAppPending returns availability of events AND timers/inputs, which
     // are processed via callbacks, so XtAppNextEvent will not return if
     // there are no events. So added '& XtIMXEvent' - Sergey.