-
-*/
-
-//-----------------------------------------------------------------------------
-// wxListMainWindow (internal)
-//-----------------------------------------------------------------------------
-
-class wxListMainWindow: public wxScrolledWindow
-{
- DECLARE_DYNAMIC_CLASS(wxListMainWindow);
-
- public:
- long m_mode;
- wxList m_lines;
- wxList m_columns;
- wxListLineData *m_current;
- int m_visibleLines;
- wxBrush *m_hilightBrush;
- wxColour *m_hilightColour;
- wxFont *m_myFont;
- int m_xScroll,m_yScroll;
- bool m_dirty;
- wxImageList *m_small_image_list;
- wxImageList *m_normal_image_list;
- int m_small_spacing;
- int m_normal_spacing;
- bool m_hasFocus;
- bool m_usedKeys;
- bool m_lastOnSame;
- wxTimer *m_renameTimer;
-// wxListTextCtrl *m_text;
- bool m_renameAccept;
- wxString m_renameRes;
- bool m_isCreated;
- bool m_isDragging;
-
- public:
- wxListMainWindow(void);
- wxListMainWindow( wxWindow *parent, const wxWindowID id,
- const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
- const long style = 0, const wxString &name = "listctrl" );
- ~wxListMainWindow(void);
- void RefreshLine( wxListLineData *line );
- void OnPaint( wxPaintEvent &event );
- void HilightAll( const bool on );
- void ActivateLine( wxListLineData *line );
- void SendNotify( wxListLineData *line, wxEventType command );
- void FocusLine( wxListLineData *line );
- void UnfocusLine( wxListLineData *line );
- void SelectLine( wxListLineData *line );
- void DeselectLine( wxListLineData *line );
- void DeleteLine( wxListLineData *line );
- void RenameLine( wxListLineData *line, const wxString &newName );
- void OnRenameTimer(void);
- void OnRenameAccept(void);
- void OnMouse( wxMouseEvent &event );
- void MoveToFocus( void );
- void OnArrowChar( wxListLineData *newCurrent, bool shiftDown );
- void OnChar( wxKeyEvent &event );
- void OnSetFocus( wxFocusEvent &event );
- void OnKillFocus( wxFocusEvent &event );
- void OnSize( wxSizeEvent &event );
- wxFont *GetMyFont( void );
- void DrawImage( int index, wxPaintDC *dc, int x, int y );
- void GetImageSize( int index, int &width, int &height );
- int GetIndexOfLine( const wxListLineData *line );
- int GetTextLength( wxString &s ); // should be const
-
- void SetImageList( wxImageList *imageList, const int which );
- void SetItemSpacing( const int spacing, const bool isSmall = FALSE );
- int GetItemSpacing( const bool isSmall = FALSE );
- void SetColumn( const int col, wxListItem &item );
- void SetColumnWidth( const int col, const int width );
- void GetColumn( const int col, wxListItem &item );
- int GetColumnWidth( const int vol );
- int GetColumnCount( void );
- int GetCountPerPage( void );
- void SetItem( wxListItem &item );
- void GetItem( wxListItem &item );
- void SetItemState( const long item, const long state, const long stateMask );
- int GetItemState( const long item, const long stateMask );
- int GetItemCount( void );
- void GetItemRect( const long index, wxRectangle &rect );
- int GetSelectedItemCount( void );
- void SetMode( const long mode );
- long GetMode( void ) const;
- void CalculatePositions( void );
- void RealizeChanges(void);
- long GetNextItem( const long item, int geometry, int state );
- void DeleteItem( const long index );
- void DeleteAllItems( void );
- void DeleteColumn( const int col );
- void DeleteEverything( void );
- void EnsureVisible( const long index );
- long FindItem(const long start, const wxString& str, const bool partial = FALSE );
- long FindItem(const long start, const long data);
- long HitTest( const int x, const int y, int &flags );
- void InsertItem( wxListItem &item );
- void InsertColumn( const long col, wxListItem &item );
- void SortItems( wxListCtrlCompare fn, long data );
- virtual bool OnListNotify( wxListEvent &event );
-
- DECLARE_EVENT_TABLE()
-};
-
-//-----------------------------------------------------------------------------
-// wxListCtrl
-//-----------------------------------------------------------------------------
-
-class wxListCtrl: public wxControl
-{
- DECLARE_DYNAMIC_CLASS(wxListCtrl);
-
- public:
-
- wxListCtrl(void);
- wxListCtrl( wxWindow *parent, const wxWindowID id,
- const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
- const long style = 0, const wxString &name = "listctrl" );
- ~wxListCtrl(void);
- bool Create( wxWindow *parent, const wxWindowID id,
- const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
- const long style = 0, const wxString &name = "listctrl" );
- void OnSize( wxSizeEvent &event );
- void SetBackgroundColour( const wxColour& col );
- bool GetColumn( const int col, wxListItem& item );
- bool SetColumn( const int col, wxListItem& item );
- int GetColumnWidth( const int col );
- bool SetColumnWidth( const int col, const int width);
- int GetCountPerPage(void); // not the same in wxGLC as in Windows, I think
-// wxText& GetEditControl(void) const; // not supported in wxGLC
- bool GetItem( wxListItem& info );
- bool SetItem( wxListItem& info ) ;
- long SetItem( const long index, const int col, const wxString& label, const int imageId = -1 );
- int GetItemState( const long item, const long stateMask );
- bool SetItemState( const long item, const long state, const long stateMask);
- bool SetItemImage( const long item, const int image, const int selImage);
- wxString GetItemText( const long item );
- void SetItemText( const long item, const wxString& str );
- long GetItemData( const long item );
- bool SetItemData( const long item, long data );
- bool GetItemRect( const long item, wxRectangle& rect, const int code = wxLIST_RECT_BOUNDS ); // not supported in wxGLC
- bool GetItemPosition( const long item, wxPoint& pos ) const; // not supported in wxGLC
- bool SetItemPosition( const long item, const wxPoint& pos ); // not supported in wxGLC
- int GetItemCount(void);
- int GetItemSpacing( bool isSmall );
- int GetSelectedItemCount(void);
-// wxColour GetTextColour(void) const; // wxGLC has colours for every Item (see wxListItem)
-// void SetTextColour(const wxColour& col);
- long GetTopItem(void);
- void SetSingleStyle( const long style, const bool add = TRUE ) ;
- void SetWindowStyleFlag(const long style);
- void RecreateWindow(void) {};
- long GetNextItem(const long item, int geometry = wxLIST_NEXT_ALL, int state = wxLIST_STATE_DONTCARE);
- wxImageList *GetImageList(const int which);
- void SetImageList(wxImageList *imageList, const int which) ;
- bool Arrange( const int flag = wxLIST_ALIGN_DEFAULT ); // always wxLIST_ALIGN_LEFT in wxGLC
- bool DeleteItem( const long item );
- bool DeleteAllItems(void) ;
- bool DeleteColumn( const int col );
-// wxText& Edit(const long item) ; // not supported in wxGLC
- bool EnsureVisible( const long item );
- long FindItem(const long start, const wxString& str, const bool partial = FALSE );
- long FindItem(const long start, const long data);
- long FindItem(const long start, const wxPoint& pt, const int direction); // not supported in wxGLC
- long HitTest(const wxPoint& point, int& flags);
- long InsertItem(wxListItem& info);
- long InsertItem(const long index, const wxString& label);
- long InsertItem(const long index, const int imageIndex);
- long InsertItem(const long index, const wxString& label, const int imageIndex);
- long InsertColumn(const long col, wxListItem& info);
- long InsertColumn(const long col, const wxString& heading, const int format = wxLIST_FORMAT_LEFT,
- const int width = -1);
- bool ScrollList(const int dx, const int dy);
- bool SortItems(wxListCtrlCompare fn, long data);
- bool Update(const long item);
- virtual bool OnListNotify(wxListEvent& WXUNUSED(event)) { return FALSE; }
- void SetDropTarget( wxDropTarget *dropTarget )
- { m_mainWin->SetDropTarget( dropTarget ); };
- wxDropTarget *GetDropTarget() const
- { return m_mainWin->GetDropTarget(); };
-
- void OnIdle( wxIdleEvent &event );
-
- protected:
-
-// wxListTextCtrl m_textCtrl;
- wxImageList *m_imageListNormal;
- wxImageList *m_imageListSmall;
- wxImageList *m_imageListState; // what's that ?
- wxListHeaderWindow *m_headerWin;
- wxListMainWindow *m_mainWin;
-
- DECLARE_EVENT_TABLE()
-
-};
-