wex v24.10.0
Public Member Functions | Protected Member Functions | List of all members
wex::grid Class Reference

Offers popup menu with copy/paste, printing. More...

#include <wex/ui/grid.h>

Inheritance diagram for wex::grid:
Inheritance graph
[legend]

Public Member Functions

 grid (const data::window &data=data::window().style(wxWANTS_CHARS))
 Default constructor.
 
bool copy_selected_cells_to_clipboard () const
 Copy from selected cells.
 
bool drop_selection (const wxGridCellCoords &drop_coords, const std::string &data)
 This one is invoked after is_allowed_drop_selection, and drops the data.
 
void empty_selection ()
 Empties selected cells.
 
bool find_next (const data::find &f)
 Finds next.
 
const std::string get_cells_value () const
 Get text from all cells.
 
const std::string get_find_string () const
 Updates find replace text.
 
const std::string get_selected_cells_value () const
 Get text from selected cells.
 
bool is_allowed_drop_selection (const wxGridCellCoords &drop_coords, const std::string &data)
 This is invoked after dragging and before anything is really dropped.
 
void paste_cells_from_clipboard ()
 Paste starting at current grid cursor.
 
void print ()
 Prints the grid.
 
void print_preview ()
 Previews the grid.
 
void set_cell_value (const wxGridCellCoords &coords, const std::string &data)
 This one is called by empty_selection, set_cells_value, and so during drag/drop as well.
 
void set_cells_value (const wxGridCellCoords &start_coords, const std::string &data)
 Fill cells with text starting at a cel.
 
void use_drag_and_drop (bool use)
 Specify whether you want to use drag/drop.
 
- Public Member Functions inherited from wex::factory::grid
virtual ~grid ()=default
 Destructor.
 

Protected Member Functions

virtual void build_popup_menu (menu &menu)
 Builds the popup menu.
 

Detailed Description

Offers popup menu with copy/paste, printing.

It also offers drag/drop functionality.

Member Function Documentation

◆ is_allowed_drop_selection()

bool wex::grid::is_allowed_drop_selection ( const wxGridCellCoords & drop_coords,
const std::string & data )

This is invoked after dragging and before anything is really dropped.

It checks for each cell whether it is read-only, etc.

◆ set_cell_value()

void wex::grid::set_cell_value ( const wxGridCellCoords & coords,
const std::string & data )

This one is called by empty_selection, set_cells_value, and so during drag/drop as well.

So it is on a cell basis, whereas the drop_selection is on a range basis.

◆ use_drag_and_drop()

void wex::grid::use_drag_and_drop ( bool use)

Specify whether you want to use drag/drop.

Default it is used.