minor doc updates
minor fixes for problems with rdrag and ldrag in tree ctrl and list ctrl
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3392
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
21 files changed:
fi
TOOLKIT_INCLUDE="$GTK_CFLAGS"
fi
TOOLKIT_INCLUDE="$GTK_CFLAGS"
- GUI_TK_LIBRARY="$GTK_LIBS"
+ GUI_TK_LIBRARY="$GTK_LIBS -ldl"
TOOLKIT=GTK
GUIOBJS=GTK_GUIOBJS
TOOLKIT=GTK
GUIOBJS=GTK_GUIOBJS
if test "$wxUSE_DRAG_AND_DROP" = "yes" ; then
if test "$wxUSE_GTK" = 1; then
if test "$WXGTK12" != 1; then
if test "$wxUSE_DRAG_AND_DROP" = "yes" ; then
if test "$wxUSE_GTK" = 1; then
if test "$WXGTK12" != 1; then
- AC_MSG_WARN([Drag and drop is only supported under wxGTK 2.1])
+ AC_MSG_WARN([Drag and drop is only supported under GTK+ 1.2])
wxUSE_DRAG_AND_DROP=no
fi
fi
wxUSE_DRAG_AND_DROP=no
fi
fi
\membersection{wxListBox::GetSelections}\label{wxlistboxgetselections}
\membersection{wxListBox::GetSelections}\label{wxlistboxgetselections}
-\constfunc{int}{GetSelections}{\param{int **}{selections}}
+\constfunc{int}{GetSelections}{\param{wxArrayInt&}{selections}}
-Gets an array containing the positions of the selected strings.
+Fill an array of ints with the positions of the currently selected items.
-\docparam{selections}{A pointer to an integer array, which will be allocated by the function if
-selects are present. Do not deallocate the returned array - it will be deallocated by the listbox.}
+\docparam{selections}{A reference to an wxArrayInt instance that is used to store the result of the query.}
\constfunc{bool}{IsExposed}{\param{int }{x}, \param{int }{y}, \param{int }{w}, \param{int }{h}}
\constfunc{bool}{IsExposed}{\param{int }{x}, \param{int }{y}, \param{int }{w}, \param{int }{h}}
-\constfunc{bool}{IsExposed}{\param{wxRectangle }{&rect}}
+\constfunc{bool}{IsExposed}{\param{wxRect }{&rect}}
Returns TRUE if the given point or rectange area has been exposed since the
last repaint. Call this in an paint event handler to optimize redrawing by
Returns TRUE if the given point or rectange area has been exposed since the
last repaint. Call this in an paint event handler to optimize redrawing by
int m_format; // left, right, centre
int m_width; // width of column
int m_format; // left, right, centre
int m_width; // width of column
};
//-----------------------------------------------------------------------------
};
//-----------------------------------------------------------------------------
class WXDLLEXPORT wxListItemData : public wxObject
{
class WXDLLEXPORT wxListItemData : public wxObject
{
- DECLARE_DYNAMIC_CLASS(wxListItemData);
-
- public:
wxString m_text;
int m_image;
long m_data;
wxString m_text;
int m_image;
long m_data;
int m_width,m_height;
wxColour *m_colour;
int m_width,m_height;
wxColour *m_colour;
- public:
- wxListItemData(void);
+public:
+ wxListItemData();
wxListItemData( const wxListItem &info );
void SetItem( const wxListItem &info );
void SetText( const wxString &s );
wxListItemData( const wxListItem &info );
void SetItem( const wxListItem &info );
void SetText( const wxString &s );
void SetPosition( int x, int y );
void SetSize( int width, int height );
void SetColour( wxColour *col );
void SetPosition( int x, int y );
void SetSize( int width, int height );
void SetColour( wxColour *col );
- bool HasImage(void) const;
- bool HasText(void) const;
+ bool HasImage() const;
+ bool HasText() const;
bool IsHit( int x, int y ) const;
void GetText( wxString &s );
int GetX( void ) const;
int GetY( void ) const;
bool IsHit( int x, int y ) const;
void GetText( wxString &s );
int GetX( void ) const;
int GetY( void ) const;
- int GetWidth(void) const;
- int GetHeight(void) const;
- int GetImage(void) const;
+ int GetWidth() const;
+ int GetHeight() const;
+ int GetImage() const;
void GetItem( wxListItem &info );
void GetItem( wxListItem &info );
- wxColour *GetColour(void);
+ wxColour *GetColour();
+
+private:
+ DECLARE_DYNAMIC_CLASS(wxListItemData);
};
//-----------------------------------------------------------------------------
};
//-----------------------------------------------------------------------------
- wxListHeaderData(void);
wxListHeaderData( const wxListItem &info );
void SetItem( const wxListItem &item );
void SetPosition( int x, int y );
void SetWidth( int w );
void SetFormat( int format );
void SetHeight( int h );
wxListHeaderData( const wxListItem &info );
void SetItem( const wxListItem &item );
void SetPosition( int x, int y );
void SetWidth( int w );
void SetFormat( int format );
void SetHeight( int h );
- bool HasImage(void) const;
- bool HasText(void) const;
+ bool HasImage() const;
+ bool HasText() const;
bool IsHit( int x, int y ) const;
void GetItem( wxListItem &item );
void GetText( wxString &s );
bool IsHit( int x, int y ) const;
void GetItem( wxListItem &item );
void GetText( wxString &s );
- int GetImage(void) const;
- int GetWidth(void) const;
- int GetFormat(void) const;
+ int GetImage() const;
+ int GetWidth() const;
+ int GetFormat() const;
};
//-----------------------------------------------------------------------------
};
//-----------------------------------------------------------------------------
- wxRect m_bound_all;
- wxRect m_bound_label;
- wxRect m_bound_icon;
- wxRect m_bound_hilight;
+ wxRect m_bound_all;
+ wxRect m_bound_label;
+ wxRect m_bound_icon;
+ wxRect m_bound_hilight;
int m_mode;
bool m_hilighted;
wxBrush *m_hilightBrush;
int m_mode;
bool m_hilighted;
wxBrush *m_hilightBrush;
void DoDraw( wxDC *dc, bool hilight, bool paintBG );
public:
void DoDraw( wxDC *dc, bool hilight, bool paintBG );
public:
- wxListLineData( void ) {};
wxListLineData( wxListMainWindow *owner, int mode, wxBrush *hilightBrush );
void CalculateSize( wxDC *dc, int spacing );
void SetPosition( wxDC *dc, int x, int y, int window_width );
wxListLineData( wxListMainWindow *owner, int mode, wxBrush *hilightBrush );
void CalculateSize( wxDC *dc, int spacing );
void SetPosition( wxDC *dc, int x, int y, int window_width );
int GetImage( int index );
void GetRect( wxRect &rect );
void Hilight( bool on );
int GetImage( int index );
void GetRect( wxRect &rect );
void Hilight( bool on );
- void ReverseHilight( void );
void DrawRubberBand( wxDC *dc, bool on );
void Draw( wxDC *dc );
bool IsInRect( int x, int y, const wxRect &rect );
void DrawRubberBand( wxDC *dc, bool on );
void Draw( wxDC *dc );
bool IsInRect( int x, int y, const wxRect &rect );
- bool IsHilighted( void );
void AssignRect( wxRect &dest, int x, int y, int width, int height );
void AssignRect( wxRect &dest, const wxRect &source );
};
void AssignRect( wxRect &dest, int x, int y, int width, int height );
void AssignRect( wxRect &dest, const wxRect &source );
};
- wxListHeaderWindow( void );
- ~wxListHeaderWindow( void );
+ wxListHeaderWindow();
+ ~wxListHeaderWindow();
wxListHeaderWindow( wxWindow *win, wxWindowID id, wxListMainWindow *owner,
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
long style = 0, const wxString &name = "columntitles" );
wxListHeaderWindow( wxWindow *win, wxWindowID id, wxListMainWindow *owner,
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
long style = 0, const wxString &name = "columntitles" );
wxString m_startValue;
public:
wxString m_startValue;
public:
- wxListTextCtrl(void) {};
wxListTextCtrl( wxWindow *parent, const wxWindowID id,
bool *accept, wxString *res, wxListMainWindow *owner,
const wxString &value = "",
wxListTextCtrl( wxWindow *parent, const wxWindowID id,
bool *accept, wxString *res, wxListMainWindow *owner,
const wxString &value = "",
wxString m_renameRes;
bool m_isCreated;
int m_dragCount;
wxString m_renameRes;
bool m_isCreated;
int m_dragCount;
public:
wxListMainWindow();
public:
wxListMainWindow();
wxImageList *m_imageListNormal,
*m_imageListState;
int m_dragCount;
wxImageList *m_imageListNormal,
*m_imageListState;
int m_dragCount;
wxTimer *m_renameTimer;
bool m_renameAccept;
wxString m_renameRes;
wxTimer *m_renameTimer;
bool m_renameAccept;
wxString m_renameRes;
void Deselect( int n );
int FindString( const wxString &item ) const;
void Deselect( int n );
int FindString( const wxString &item ) const;
- int GetSelection(void) const;
+ int GetSelection() const;
int GetSelections( class wxArrayInt &) const;
wxString GetString( int n ) const;
int GetSelections( class wxArrayInt &) const;
wxString GetString( int n ) const;
- wxString GetStringSelection(void) const;
+ wxString GetStringSelection() const;
int Number();
bool Selected( int n );
void Set( int n, const wxString *choices );
int Number();
bool Selected( int n );
void Set( int n, const wxString *choices );
- wxMDIParentFrame(void);
wxMDIParentFrame( wxWindow *parent,
wxWindowID id, const wxString& title,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
wxMDIParentFrame( wxWindow *parent,
wxWindowID id, const wxString& title,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
wxWindowID id, const wxString& title,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr );
wxWindowID id, const wxString& title,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr );
- ~wxMDIChildFrame(void);
bool Create( wxMDIParentFrame *parent,
wxWindowID id, const wxString& title,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
bool Create( wxMDIParentFrame *parent,
wxWindowID id, const wxString& title,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
- wxMDIClientWindow(void);
wxMDIClientWindow( wxMDIParentFrame *parent, long style = 0 );
wxMDIClientWindow( wxMDIParentFrame *parent, long style = 0 );
- ~wxMDIClientWindow(void);
virtual bool CreateClient( wxMDIParentFrame *parent, long style = wxVSCROLL | wxHSCROLL );
};
virtual bool CreateClient( wxMDIParentFrame *parent, long style = wxVSCROLL | wxHSCROLL );
};
void Deselect( int n );
int FindString( const wxString &item ) const;
void Deselect( int n );
int FindString( const wxString &item ) const;
- int GetSelection(void) const;
+ int GetSelection() const;
int GetSelections( class wxArrayInt &) const;
wxString GetString( int n ) const;
int GetSelections( class wxArrayInt &) const;
wxString GetString( int n ) const;
- wxString GetStringSelection(void) const;
+ wxString GetStringSelection() const;
int Number();
bool Selected( int n );
void Set( int n, const wxString *choices );
int Number();
bool Selected( int n );
void Set( int n, const wxString *choices );
- wxMDIParentFrame(void);
wxMDIParentFrame( wxWindow *parent,
wxWindowID id, const wxString& title,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
wxMDIParentFrame( wxWindow *parent,
wxWindowID id, const wxString& title,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
wxWindowID id, const wxString& title,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr );
wxWindowID id, const wxString& title,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr );
- ~wxMDIChildFrame(void);
bool Create( wxMDIParentFrame *parent,
wxWindowID id, const wxString& title,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
bool Create( wxMDIParentFrame *parent,
wxWindowID id, const wxString& title,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
- wxMDIClientWindow(void);
wxMDIClientWindow( wxMDIParentFrame *parent, long style = 0 );
wxMDIClientWindow( wxMDIParentFrame *parent, long style = 0 );
- ~wxMDIClientWindow(void);
virtual bool CreateClient( wxMDIParentFrame *parent, long style = wxVSCROLL | wxHSCROLL );
};
virtual bool CreateClient( wxMDIParentFrame *parent, long style = wxVSCROLL | wxHSCROLL );
};
#include <sys/un.h>
class WXDLLEXPORT wxUNIXaddress : public wxSockAddress {
#include <sys/un.h>
class WXDLLEXPORT wxUNIXaddress : public wxSockAddress {
// define wxStricmp for various compilers without Unicode possibilities
#if !defined(wxStricmp) && !wxUSE_UNICODE
// define wxStricmp for various compilers without Unicode possibilities
#if !defined(wxStricmp) && !wxUSE_UNICODE
-# if defined(__BORLANDC__) || defined(__WATCOMC__) || defined(__SALFORDC__) || defined(__VISAGECPP__)
+# if defined(__BORLANDC__) || defined(__WATCOMC__) || defined(__SALFORDC__) || defined(__VISAGECPP__) || defined(__EMX__)
# define wxStricmp stricmp
# elif defined(__SC__) || defined(__VISUALC__) || (defined(__MWERKS) && defined(__INTEL__))
# define wxStricmp _stricmp
# define wxStricmp stricmp
# elif defined(__SC__) || defined(__VISUALC__) || (defined(__MWERKS) && defined(__INTEL__))
# define wxStricmp _stricmp
-void MyListCtrl::OnBeginDrag(wxListEvent& WXUNUSED(event))
+void MyListCtrl::OnBeginDrag(wxListEvent& event)
{
if ( !wxGetApp().GetTopWindow() )
return;
{
if ( !wxGetApp().GetTopWindow() )
return;
- text->WriteText("OnBeginDrag\n");
+ wxString msg;
+ msg.Printf( "OnBeginDrag at %d,%d.\n", event.m_pointDrag.x, event.m_pointDrag.y );
+ text->WriteText(msg);
-void MyListCtrl::OnBeginRDrag(wxListEvent& WXUNUSED(event))
+void MyListCtrl::OnBeginRDrag(wxListEvent& event)
{
if ( !wxGetApp().GetTopWindow() )
return;
{
if ( !wxGetApp().GetTopWindow() )
return;
wxTextCtrl *text = ((MyFrame *)wxGetApp().GetTopWindow())->m_logWindow;
if ( !text )
return;
wxTextCtrl *text = ((MyFrame *)wxGetApp().GetTopWindow())->m_logWindow;
if ( !text )
return;
- text->WriteText("OnBeginRDrag\n");
+
+ wxString msg;
+ msg.Printf( "OnBeginRDrag at %d,%d.\n", event.m_pointDrag.x, event.m_pointDrag.y );
+ text->WriteText(msg);
-void MyListCtrl::OnBeginLabelEdit(wxListEvent& WXUNUSED(event))
+void MyListCtrl::OnBeginLabelEdit(wxListEvent& event)
{
if ( !wxGetApp().GetTopWindow() )
return;
{
if ( !wxGetApp().GetTopWindow() )
return;
- text->WriteText("OnBeginLabelEdit\n");
+ text->WriteText("OnBeginLabelEdit: ");
+ text->WriteText(event.m_item.m_text);
+ text->WriteText("\n");
-void MyListCtrl::OnEndLabelEdit(wxListEvent& WXUNUSED(event))
+void MyListCtrl::OnEndLabelEdit(wxListEvent& event)
{
if ( !wxGetApp().GetTopWindow() )
return;
{
if ( !wxGetApp().GetTopWindow() )
return;
- text->WriteText("OnEndLabelEdit\n");
+ text->WriteText("OnEndLabelEdit: ");
+ text->WriteText(event.m_item.m_text);
+ if (event.m_cancelled)
+ text->WriteText(" cancelled by user\n");
+ else
+ text->WriteText(" accepted by user\n");
}
void MyListCtrl::OnDeleteItem(wxListEvent& WXUNUSED(event))
}
void MyListCtrl::OnDeleteItem(wxListEvent& WXUNUSED(event))
text->WriteText("OnDeleteItem\n");
}
text->WriteText("OnDeleteItem\n");
}
-void MyListCtrl::OnGetInfo(wxListEvent& /*event*/)
+void MyListCtrl::OnGetInfo(wxListEvent& event)
{
if ( !wxGetApp().GetTopWindow() )
return;
{
if ( !wxGetApp().GetTopWindow() )
return;
- text->WriteText("OnGetInfo\n");
-
-/*
- ostream str(text);
+ text->WriteText("OnGetInfo\n");
- str << "OnGetInfo (" << event.m_item.m_itemId << ", " << event.m_item.m_col << ")";
+ (*text) << "OnGetInfo (" << event.m_item.m_itemId << ", " << event.m_item.m_col << ")";
if ( event.m_item.m_mask & wxLIST_MASK_STATE )
if ( event.m_item.m_mask & wxLIST_MASK_STATE )
- str << " wxLIST_MASK_STATE";
+ (*text) << " wxLIST_MASK_STATE";
if ( event.m_item.m_mask & wxLIST_MASK_TEXT )
if ( event.m_item.m_mask & wxLIST_MASK_TEXT )
- str << " wxLIST_MASK_TEXT";
+ (*text) << " wxLIST_MASK_TEXT";
if ( event.m_item.m_mask & wxLIST_MASK_IMAGE )
if ( event.m_item.m_mask & wxLIST_MASK_IMAGE )
- str << " wxLIST_MASK_IMAGE";
+ (*text) << " wxLIST_MASK_IMAGE";
if ( event.m_item.m_mask & wxLIST_MASK_DATA )
if ( event.m_item.m_mask & wxLIST_MASK_DATA )
- str << " wxLIST_MASK_DATA";
+ (*text) << " wxLIST_MASK_DATA";
if ( event.m_item.m_mask & wxLIST_SET_ITEM )
if ( event.m_item.m_mask & wxLIST_SET_ITEM )
- str << " wxLIST_SET_ITEM";
+ (*text) << " wxLIST_SET_ITEM";
if ( event.m_item.m_mask & wxLIST_MASK_WIDTH )
if ( event.m_item.m_mask & wxLIST_MASK_WIDTH )
- str << " wxLIST_MASK_WIDTH";
+ (*text) << " wxLIST_MASK_WIDTH";
if ( event.m_item.m_mask & wxLIST_MASK_FORMAT )
if ( event.m_item.m_mask & wxLIST_MASK_FORMAT )
- str << " wxLIST_MASK_WIDTH";
+ (*text) << " wxLIST_MASK_WIDTH";
if ( event.m_item.m_mask & wxLIST_MASK_TEXT )
{
event.m_item.m_text = "My callback text";
}
if ( event.m_item.m_mask & wxLIST_MASK_TEXT )
{
event.m_item.m_text = "My callback text";
}
- str << "\n";
- str.flush();
-*/
}
void MyListCtrl::OnSetInfo(wxListEvent& WXUNUSED(event))
}
void MyListCtrl::OnSetInfo(wxListEvent& WXUNUSED(event))
IMPLEMENT_DYNAMIC_CLASS(wxListItemData,wxObject);
IMPLEMENT_DYNAMIC_CLASS(wxListItemData,wxObject);
-wxListItemData::wxListItemData(void)
+wxListItemData::wxListItemData()
{
m_image = -1;
m_data = 0;
{
m_image = -1;
m_data = 0;
-bool wxListItemData::HasImage(void) const
+bool wxListItemData::HasImage() const
{
return (m_image >= 0);
}
{
return (m_image >= 0);
}
-bool wxListItemData::HasText(void) const
+bool wxListItemData::HasText() const
{
return (!m_text.IsNull());
}
{
return (!m_text.IsNull());
}
-int wxListItemData::GetX( void ) const
+int wxListItemData::GetX() const
-int wxListItemData::GetY( void ) const
+int wxListItemData::GetY() const
-int wxListItemData::GetWidth(void) const
+int wxListItemData::GetWidth() const
-int wxListItemData::GetHeight(void) const
+int wxListItemData::GetHeight() const
-int wxListItemData::GetImage(void) const
+int wxListItemData::GetImage() const
-wxColour *wxListItemData::GetColour(void)
+wxColour *wxListItemData::GetColour()
IMPLEMENT_DYNAMIC_CLASS(wxListHeaderData,wxObject);
IMPLEMENT_DYNAMIC_CLASS(wxListHeaderData,wxObject);
-wxListHeaderData::wxListHeaderData(void)
+wxListHeaderData::wxListHeaderData()
{
m_mask = 0;
m_image = 0;
{
m_mask = 0;
m_image = 0;
-bool wxListHeaderData::HasImage(void) const
+bool wxListHeaderData::HasImage() const
{
return (m_image != 0);
}
{
return (m_image != 0);
}
-bool wxListHeaderData::HasText(void) const
+bool wxListHeaderData::HasText() const
{
return (m_text.Length() > 0);
}
{
return (m_text.Length() > 0);
}
-int wxListHeaderData::GetImage(void) const
+int wxListHeaderData::GetImage() const
-int wxListHeaderData::GetWidth(void) const
+int wxListHeaderData::GetWidth() const
-int wxListHeaderData::GetFormat(void) const
+int wxListHeaderData::GetFormat() const
EVT_KILL_FOCUS (wxListMainWindow::OnKillFocus)
END_EVENT_TABLE()
EVT_KILL_FOCUS (wxListMainWindow::OnKillFocus)
END_EVENT_TABLE()
-wxListMainWindow::wxListMainWindow( void )
+wxListMainWindow::wxListMainWindow()
{
m_mode = 0;
m_lines.DeleteContents( TRUE );
{
m_mode = 0;
m_lines.DeleteContents( TRUE );
SetBackgroundColour( *wxWHITE );
}
SetBackgroundColour( *wxWHITE );
}
-wxListMainWindow::~wxListMainWindow( void )
+wxListMainWindow::~wxListMainWindow()
{
if (m_hilightBrush) delete m_hilightBrush;
{
if (m_hilightBrush) delete m_hilightBrush;
m_currentEdit = (wxListLineData*) node->Data();
m_currentEdit = (wxListLineData*) node->Data();
- wxListEvent le( wxEVT_COMMAND_LIST_END_LABEL_EDIT, GetParent()->GetId() );
+ wxListEvent le( wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT, GetParent()->GetId() );
le.SetEventObject( GetParent() );
le.m_itemIndex = GetIndexOfLine( m_currentEdit );
m_currentEdit->GetItem( 0, le.m_item );
le.SetEventObject( GetParent() );
le.m_itemIndex = GetIndexOfLine( m_currentEdit );
m_currentEdit->GetItem( 0, le.m_item );
if (!m_current) return;
if (m_dirty) return;
if (!m_current) return;
if (m_dirty) return;
+ if ( !(event.Dragging() || event.ButtonDown() || event.LeftUp()) ) return;
wxClientDC dc(this);
PrepareDC(dc);
wxClientDC dc(this);
PrepareDC(dc);
- if (!event.Dragging())
- m_dragCount = 0;
- else
- m_dragCount++;
-
- if (event.Dragging() && (m_dragCount > 3))
+ if (m_dragCount == 0)
+ m_dragStart = wxPoint(x,y);
+
+ m_dragCount++;
+
+ if (m_dragCount != 3) return;
- wxListEvent le( wxEVT_COMMAND_LIST_BEGIN_DRAG, GetParent()->GetId() );
+ int command = wxEVT_COMMAND_LIST_BEGIN_DRAG;
+ if (event.RightIsDown()) command = wxEVT_COMMAND_LIST_BEGIN_RDRAG;
+
+ wxListEvent le( command, GetParent()->GetId() );
le.SetEventObject( GetParent() );
le.SetEventObject( GetParent() );
- le.m_pointDrag.x = x;
- le.m_pointDrag.y = y;
+ le.m_pointDrag = m_dragStart;
GetParent()->GetEventHandler()->ProcessEvent( le );
return;
}
GetParent()->GetEventHandler()->ProcessEvent( le );
return;
}
+ else
+ {
+ m_dragCount = 0;
+ }
IMPLEMENT_DYNAMIC_CLASS(wxListItem, wxObject)
IMPLEMENT_DYNAMIC_CLASS(wxListItem, wxObject)
-wxListItem::wxListItem(void)
+wxListItem::wxListItem()
{
m_mask = 0;
m_itemId = 0;
{
m_mask = 0;
m_itemId = 0;
EVT_IDLE (wxListCtrl::OnIdle)
END_EVENT_TABLE()
EVT_IDLE (wxListCtrl::OnIdle)
END_EVENT_TABLE()
-wxListCtrl::wxListCtrl(void)
+wxListCtrl::wxListCtrl()
{
m_imageListNormal = (wxImageList *) NULL;
m_imageListSmall = (wxImageList *) NULL;
{
m_imageListNormal = (wxImageList *) NULL;
m_imageListSmall = (wxImageList *) NULL;
m_headerWin = (wxListHeaderWindow*) NULL;
}
m_headerWin = (wxListHeaderWindow*) NULL;
}
-wxListCtrl::~wxListCtrl(void)
+wxListCtrl::~wxListCtrl()
-int wxListCtrl::GetCountPerPage(void) const
+int wxListCtrl::GetCountPerPage() const
{
return m_mainWin->GetCountPerPage(); // different from Windows ?
}
{
return m_mainWin->GetCountPerPage(); // different from Windows ?
}
-int wxListCtrl::GetItemCount(void) const
+int wxListCtrl::GetItemCount() const
{
return m_mainWin->GetItemCount();
}
{
return m_mainWin->GetItemCount();
}
-int wxListCtrl::GetColumnCount(void) const
+int wxListCtrl::GetColumnCount() const
{
return m_mainWin->GetColumnCount();
}
{
return m_mainWin->GetColumnCount();
}
return m_mainWin->GetItemSpacing( isSmall );
}
return m_mainWin->GetItemSpacing( isSmall );
}
-int wxListCtrl::GetSelectedItemCount(void) const
+int wxListCtrl::GetSelectedItemCount() const
{
return m_mainWin->GetSelectedItemCount();
}
/*
{
return m_mainWin->GetSelectedItemCount();
}
/*
-wxColour wxListCtrl::GetTextColour(void) const
+wxColour wxListCtrl::GetTextColour() const
-long wxListCtrl::GetTopItem(void) const
+long wxListCtrl::GetTopItem() const
-bool wxListCtrl::DeleteAllItems(void)
+bool wxListCtrl::DeleteAllItems()
{
m_mainWin->DeleteAllItems();
return TRUE;
{
m_mainWin->DeleteAllItems();
return TRUE;
void wxTreeCtrl::OnMouse( wxMouseEvent &event )
{
void wxTreeCtrl::OnMouse( wxMouseEvent &event )
{
- if (!event.LeftIsDown()) m_dragCount = 0;
-
if ( !(event.LeftUp() || event.LeftDClick() || event.Dragging()) ) return;
if ( !m_anchor ) return;
if ( !(event.LeftUp() || event.LeftDClick() || event.Dragging()) ) return;
if ( !m_anchor ) return;
wxGenericTreeItem *item = m_anchor->HitTest( wxPoint(x,y), this, flags);
bool onButton = flags & wxTREE_HITTEST_ONITEMBUTTON;
wxGenericTreeItem *item = m_anchor->HitTest( wxPoint(x,y), this, flags);
bool onButton = flags & wxTREE_HITTEST_ONITEMBUTTON;
- if (item == NULL) return; /* we hit the blank area */
-
- if (m_dragCount == 2) /* small drag latency (3?) */
- {
- m_dragCount = 0;
-
- wxTreeEvent nevent(wxEVT_COMMAND_TREE_BEGIN_DRAG, GetId());
- nevent.m_item = m_current;
- nevent.SetEventObject(this);
- GetEventHandler()->ProcessEvent(nevent);
- }
- else
- {
- m_dragCount++;
- }
- return;
+ if (m_dragCount == 0)
+ m_dragStart = wxPoint(x,y);
+
+ m_dragCount++;
+
+ if (m_dragCount != 3) return;
+
+ int command = wxEVT_COMMAND_TREE_BEGIN_DRAG;
+ if (event.RightIsDown()) command = wxEVT_COMMAND_TREE_BEGIN_RDRAG;
+
+ wxTreeEvent nevent( command, GetId() );
+ nevent.m_item = m_current;
+ nevent.SetEventObject(this);
+ GetEventHandler()->ProcessEvent(nevent);
+ return;
+ else
+ {
+ m_dragCount = 0;
+ }
+
+ if (item == NULL) return; /* we hit the blank area */
if (event.LeftUp() && (item == m_current) &&
(flags & wxTREE_HITTEST_ONITEMLABEL) &&
if (event.LeftUp() && (item == m_current) &&
(flags & wxTREE_HITTEST_ONITEMLABEL) &&
if (!wxOKlibc()) wxConvCurrent = &wxConvLocal;
if (!wxOKlibc()) wxConvCurrent = &wxConvLocal;
+#else
+ if (!wxOKlibc()) wxConvCurrent = (wxMBConv*) NULL;
+#endif
gtk_init( &argc, &argv );
gtk_init( &argc, &argv );
m_items.Append( mitem );
}
m_items.Append( mitem );
}
+#if (GTK_MINOR_VERSION > 0)
static char* GetHotKey( const wxString &hotkey, char *hotbuf )
{
if (hotkey.IsEmpty()) return (char*) NULL;
static char* GetHotKey( const wxString &hotkey, char *hotbuf )
{
if (hotkey.IsEmpty()) return (char*) NULL;
void wxMenu::Append( int id, const wxString &item, const wxString &helpStr, bool checkable )
{
void wxMenu::Append( int id, const wxString &item, const wxString &helpStr, bool checkable )
{
justify = GTK_JUSTIFY_LEFT;
gtk_label_set_justify(GTK_LABEL(m_widget), justify);
justify = GTK_JUSTIFY_LEFT;
gtk_label_set_justify(GTK_LABEL(m_widget), justify);
-#if GTK_MINOR_VERSION == 2
+//#if GTK_MINOR_VERSION == 2
// GTK_JUSTIFY_LEFT is 0, RIGHT 1 and CENTER 2
static const float labelAlignments[] = { 0.0, 1.0, 0.5 };
gtk_misc_set_alignment(GTK_MISC(m_widget), labelAlignments[justify], 0.0);
// GTK_JUSTIFY_LEFT is 0, RIGHT 1 and CENTER 2
static const float labelAlignments[] = { 0.0, 1.0, 0.5 };
gtk_misc_set_alignment(GTK_MISC(m_widget), labelAlignments[justify], 0.0);
GtkRequisition req;
(* GTK_WIDGET_CLASS( GTK_OBJECT(m_widget)->klass )->size_request ) (m_widget, &req );
GtkRequisition req;
(* GTK_WIDGET_CLASS( GTK_OBJECT(m_widget)->klass )->size_request ) (m_widget, &req );
if (!wxOKlibc()) wxConvCurrent = &wxConvLocal;
if (!wxOKlibc()) wxConvCurrent = &wxConvLocal;
+#else
+ if (!wxOKlibc()) wxConvCurrent = (wxMBConv*) NULL;
+#endif
gtk_init( &argc, &argv );
gtk_init( &argc, &argv );
m_items.Append( mitem );
}
m_items.Append( mitem );
}
+#if (GTK_MINOR_VERSION > 0)
static char* GetHotKey( const wxString &hotkey, char *hotbuf )
{
if (hotkey.IsEmpty()) return (char*) NULL;
static char* GetHotKey( const wxString &hotkey, char *hotbuf )
{
if (hotkey.IsEmpty()) return (char*) NULL;
void wxMenu::Append( int id, const wxString &item, const wxString &helpStr, bool checkable )
{
void wxMenu::Append( int id, const wxString &item, const wxString &helpStr, bool checkable )
{
justify = GTK_JUSTIFY_LEFT;
gtk_label_set_justify(GTK_LABEL(m_widget), justify);
justify = GTK_JUSTIFY_LEFT;
gtk_label_set_justify(GTK_LABEL(m_widget), justify);
-#if GTK_MINOR_VERSION == 2
+//#if GTK_MINOR_VERSION == 2
// GTK_JUSTIFY_LEFT is 0, RIGHT 1 and CENTER 2
static const float labelAlignments[] = { 0.0, 1.0, 0.5 };
gtk_misc_set_alignment(GTK_MISC(m_widget), labelAlignments[justify], 0.0);
// GTK_JUSTIFY_LEFT is 0, RIGHT 1 and CENTER 2
static const float labelAlignments[] = { 0.0, 1.0, 0.5 };
gtk_misc_set_alignment(GTK_MISC(m_widget), labelAlignments[justify], 0.0);
GtkRequisition req;
(* GTK_WIDGET_CLASS( GTK_OBJECT(m_widget)->klass )->size_request ) (m_widget, &req );
GtkRequisition req;
(* GTK_WIDGET_CLASS( GTK_OBJECT(m_widget)->klass )->size_request ) (m_widget, &req );
#if !defined(HAVE_USLEEP) && \
(defined(__SUN__) && !defined(__SunOs_5_6) && \
!defined(__SunOs_5_7) && !defined(__SUNPRO_CC)) || \
#if !defined(HAVE_USLEEP) && \
(defined(__SUN__) && !defined(__SunOs_5_6) && \
!defined(__SunOs_5_7) && !defined(__SUNPRO_CC)) || \
+ defined(__osf__) || defined(__EMX__)
extern "C"
{
#ifdef __SUN__
extern "C"
{
#ifdef __SUN__
#ifdef __EMX__
/* I copied this from the XFree86 diffs. AV. */
#ifdef __EMX__
/* I copied this from the XFree86 diffs. AV. */
-extern void DosSleep(unsigned long);
+//extern void DosSleep(unsigned long);
#define INCL_DOSPROCESS
#include <os2.h>
void usleep(unsigned long delay)
#define INCL_DOSPROCESS
#include <os2.h>
void usleep(unsigned long delay)